From 385b513822dff84e2faeb7f1d1b60efdf3d82fab Mon Sep 17 00:00:00 2001 From: Josh Kleinpeter Date: Thu, 17 Mar 2011 15:09:09 -0700 Subject: [PATCH 1/3] Made fixed_range a required parameter for nova-manage network create. Changed default num_networks to 1; 1000 seems large. --- bin/nova-manage | 5 +++-- nova/network/manager.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index a4d820209a6c..0c39b662c80a 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -518,11 +518,12 @@ class NetworkCommands(object): network_size=None, vlan_start=None, vpn_start=None, fixed_range_v6=None, label='public'): """Creates fixed ips for host by range - arguments: [fixed_range=FLAG], [num_networks=FLAG], + arguments: fixed_range=FLAG, [num_networks=FLAG], [network_size=FLAG], [vlan_start=FLAG], [vpn_start=FLAG], [fixed_range_v6=FLAG]""" if not fixed_range: - fixed_range = FLAGS.fixed_range + raise ValueError('Fixed range in the form of 10.0.0.0/8 is ' + 'required to create networks.') if not num_networks: num_networks = FLAGS.num_networks if not network_size: diff --git a/nova/network/manager.py b/nova/network/manager.py index 3dfc48934b6b..f2025af0625c 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -73,7 +73,7 @@ flags.DEFINE_string('flat_interface', None, flags.DEFINE_string('flat_network_dhcp_start', '10.0.0.2', 'Dhcp start for FlatDhcp') flags.DEFINE_integer('vlan_start', 100, 'First VLAN for private networks') -flags.DEFINE_integer('num_networks', 1000, 'Number of networks to support') +flags.DEFINE_integer('num_networks', 1, 'Number of networks to support') flags.DEFINE_string('vpn_ip', '$my_ip', 'Public IP for the cloudpipe VPN servers') flags.DEFINE_integer('vpn_start', 1000, 'First Vpn port for private networks') From 665e155339b8c4498e39e783710d869dcfc94238 Mon Sep 17 00:00:00 2001 From: Josh Kleinpeter Date: Mon, 21 Mar 2011 09:06:42 -0500 Subject: [PATCH 2/3] Added my name to Authors Added I18n for network create string --- Authors | 1 + bin/nova-manage | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Authors b/Authors index 9aad104a7998..1679d2dee150 100644 --- a/Authors +++ b/Authors @@ -33,6 +33,7 @@ Jonathan Bryce Jordan Rinke Josh Durgin Josh Kearney +Josh Kleinpeter Joshua McKenty Justin Santa Barbara Kei Masumoto diff --git a/bin/nova-manage b/bin/nova-manage index 0c39b662c80a..53e954003bb5 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -522,8 +522,8 @@ class NetworkCommands(object): [network_size=FLAG], [vlan_start=FLAG], [vpn_start=FLAG], [fixed_range_v6=FLAG]""" if not fixed_range: - raise ValueError('Fixed range in the form of 10.0.0.0/8 is ' - 'required to create networks.') + raise ValueError(_('Fixed range in the form of 10.0.0.0/8 is ' + 'required to create networks.')) if not num_networks: num_networks = FLAGS.num_networks if not network_size: From 3754a7b6f4cf0e9c60a140348b4cdb9c8acde062 Mon Sep 17 00:00:00 2001 From: Josh Kleinpeter Date: Mon, 21 Mar 2011 09:17:12 -0500 Subject: [PATCH 3/3] Changed error to TypeError so that we get the arguments list. --- bin/nova-manage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 53e954003bb5..bdc129077f36 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -522,8 +522,8 @@ class NetworkCommands(object): [network_size=FLAG], [vlan_start=FLAG], [vpn_start=FLAG], [fixed_range_v6=FLAG]""" if not fixed_range: - raise ValueError(_('Fixed range in the form of 10.0.0.0/8 is ' - 'required to create networks.')) + raise TypeError(_('Fixed range in the form of 10.0.0.0/8 is ' + 'required to create networks.')) if not num_networks: num_networks = FLAGS.num_networks if not network_size: