diff options
-rwxr-xr-x | ci/deploy.sh | 17 | ||||
-rw-r--r-- | docs/installationprocedure/baremetal.rst | 5 | ||||
-rw-r--r-- | docs/installationprocedure/virtualinstall.rst | 2 | ||||
-rwxr-xr-x | lib/configure-deps-functions.sh | 6 | ||||
-rwxr-xr-x | lib/overcloud-deploy-functions.sh | 13 | ||||
-rwxr-xr-x | lib/parse-functions.sh | 6 | ||||
-rw-r--r-- | lib/python/apex/network_settings.py | 3 | ||||
-rwxr-xr-x | lib/python/apex_python_utils.py | 14 | ||||
-rwxr-xr-x | lib/undercloud-functions.sh | 89 | ||||
-rw-r--r-- | tests/test_apex_network_environment.py | 10 | ||||
-rw-r--r-- | tests/test_apex_network_settings.py | 50 | ||||
-rw-r--r-- | tests/test_apex_python_utils_py.py | 1 |
12 files changed, 86 insertions, 130 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index 24c26d94..edc6062a 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -25,8 +25,6 @@ green=$(tput setaf 2 || echo "") interactive="FALSE" ping_site="8.8.8.8" ntp_server="pool.ntp.org" -net_isolation_enabled="TRUE" -net_isolation_arg="" post_config="TRUE" debug="FALSE" @@ -129,12 +127,6 @@ parse_cmdline() { echo "Executing a Virtual Deployment" shift 1 ;; - --flat ) - net_isolation_enabled="FALSE" - net_isolation_arg="--flat" - echo "Underlay Network Isolation Disabled: using flat configuration" - shift 1 - ;; --no-post-config ) post_config="FALSE" echo "Post install configuration disabled" @@ -173,9 +165,7 @@ parse_cmdline() { done sleep 2 - if [[ ! -z "$NETSETS" && "$net_isolation_enabled" == "FALSE" ]]; then - echo -e "${red}INFO: Single flat network requested. Only admin network settings will be used!${reset}" - elif [[ -z "$NETSETS" ]]; then + if [[ -z "$NETSETS" ]]; then echo -e "${red}ERROR: You must provide a network_settings file with -n.${reset}" exit 1 fi @@ -206,11 +196,6 @@ parse_cmdline() { exit 1 fi - if [[ "$net_isolation_enabled" == "FALSE" && "$post_config" == "TRUE" ]]; then - echo -e "${blue}INFO: Post Install Configuration will be skipped. It is not supported with --flat${reset}" - post_config="FALSE" - fi - } main() { diff --git a/docs/installationprocedure/baremetal.rst b/docs/installationprocedure/baremetal.rst index d41c77e0..2de6e8a8 100644 --- a/docs/installationprocedure/baremetal.rst +++ b/docs/installationprocedure/baremetal.rst @@ -230,11 +230,10 @@ You are now ready to deploy OPNFV using Apex! Follow the steps below to execute: 1. Execute opnfv-deploy - ``sudo opnfv-deploy [ --flat ] -n network_settings.yaml + ``sudo opnfv-deploy -n network_settings.yaml -i inventory.yaml -d deploy_settings.yaml`` If you need more information about the options that can be passed to - opnfv-deploy use ``opnfv-deploy --help`` --flat collapses all networks to a - single nic, only uses the admin network from the network settings file. -n + opnfv-deploy use ``opnfv-deploy --help``. -n network_settings.yaml allows you to customize your networking topology. 2. Wait while deployment is executed. diff --git a/docs/installationprocedure/virtualinstall.rst b/docs/installationprocedure/virtualinstall.rst index 01971893..d2c81abe 100644 --- a/docs/installationprocedure/virtualinstall.rst +++ b/docs/installationprocedure/virtualinstall.rst @@ -49,7 +49,7 @@ environment will deploy with the following architecture: Follow the steps below to execute: 1. ``sudo opnfv-deploy -v [ --virtual-computes n ] - [ --virtual-cpus n ] [ --virtual-ram n ] [ --flat ] + [ --virtual-cpus n ] [ --virtual-ram n ] -n network_settings.yaml -i inventory.yaml -d deploy_settings.yaml`` 2. It will take approximately 45 minutes to an hour to stand up undercloud, diff --git a/lib/configure-deps-functions.sh b/lib/configure-deps-functions.sh index 11bba446..1d238f87 100755 --- a/lib/configure-deps-functions.sh +++ b/lib/configure-deps-functions.sh @@ -33,12 +33,8 @@ function configure_deps { systemctl status libvirtd || systemctl start libvirtd systemctl status openvswitch || systemctl start openvswitch - # If flat we only use admin network - if [[ "$net_isolation_enabled" == "FALSE" ]]; then - virsh_enabled_networks="admin" - enabled_network_list="admin" # For baremetal we only need to create/attach Undercloud to admin and external - elif [ "$virtual" == "FALSE" ]; then + if [ "$virtual" == "FALSE" ]; then virsh_enabled_networks="admin external" else virsh_enabled_networks=$enabled_network_list diff --git a/lib/overcloud-deploy-functions.sh b/lib/overcloud-deploy-functions.sh index 60d5e140..2066f15a 100755 --- a/lib/overcloud-deploy-functions.sh +++ b/lib/overcloud-deploy-functions.sh @@ -204,6 +204,10 @@ EOI # make sure ceph is installed DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml" + #DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml" + DEPLOY_OPTIONS+=" -e network-environment.yaml" + + # get number of nodes available in inventory num_control_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:control /home/stack/instackenv.json") num_compute_nodes=$(ssh -T ${SSH_OPTIONS[@]} "root@$UNDERCLOUD" "grep -c profile:compute /home/stack/instackenv.json") @@ -233,14 +237,7 @@ EOI DEPLOY_OPTIONS+=" --compute-scale ${num_compute_nodes}" fi - if [[ "$net_isolation_enabled" == "TRUE" ]]; then - #DEPLOY_OPTIONS+=" -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml" - DEPLOY_OPTIONS+=" -e network-environment.yaml" - fi - - if [[ "$ha_enabled" == "True" ]] || [[ "$net_isolation_enabled" == "TRUE" ]]; then - DEPLOY_OPTIONS+=" --ntp-server $ntp_server" - fi + DEPLOY_OPTIONS+=" --ntp-server $ntp_server" DEPLOY_OPTIONS+=" --control-flavor control --compute-flavor compute" if [[ "$virtual" == "TRUE" ]]; then diff --git a/lib/parse-functions.sh b/lib/parse-functions.sh index 4b3d2346..84da75c5 100755 --- a/lib/parse-functions.sh +++ b/lib/parse-functions.sh @@ -25,7 +25,7 @@ parse_network_settings() { done fi - if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS $net_isolation_arg -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then + if output=$(python3 -B $LIB/python/apex_python_utils.py parse-net-settings -s $NETSETS -td $APEX_TMP_DIR -e $CONFIG/network-environment.yaml $parse_ext); then echo -e "${blue}${output}${reset}" eval "$output" else @@ -34,10 +34,6 @@ parse_network_settings() { fi if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then - if [ "$net_isolation_enabled" == "FALSE" ]; then - echo -e "${red}ERROR: flat network is not supported with ovs-dpdk ${reset}" - exit 1 - fi if [[ ! $enabled_network_list =~ "tenant" ]]; then echo -e "${red}ERROR: tenant network is not enabled for ovs-dpdk ${reset}" exit 1 diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py index 11798085..006d18c3 100644 --- a/lib/python/apex/network_settings.py +++ b/lib/python/apex/network_settings.py @@ -39,7 +39,7 @@ class NetworkSettings(dict): for deploy.sh consumption. This object will later be used directly as deployment script move to python. """ - def __init__(self, filename, network_isolation): + def __init__(self, filename): init_dict = {} if type(filename) is str: with open(filename, 'r') as network_settings_file: @@ -63,7 +63,6 @@ class NetworkSettings(dict): # merge the apex specific config into the first class settings merge(self, copy(self['apex'])) - self.network_isolation = network_isolation self.enabled_network_list = [] self.nics = {COMPUTE: {}, CONTROLLER: {}} self.nics_specified = {COMPUTE: False, CONTROLLER: False} diff --git a/lib/python/apex_python_utils.py b/lib/python/apex_python_utils.py index b67028ac..b0ebb270 100755 --- a/lib/python/apex_python_utils.py +++ b/lib/python/apex_python_utils.py @@ -33,11 +33,8 @@ def parse_net_settings(args): Args: - file: string file to network_settings.yaml file - - network_isolation: bool - enable or disable network_isolation """ - settings = NetworkSettings(args.net_settings_file, - args.network_isolation) + settings = NetworkSettings(args.net_settings_file) net_env = NetworkEnvironment(settings, args.net_env_file, args.compute_pre_config, args.controller_pre_config) @@ -106,8 +103,7 @@ def build_nic_template(args): """ template_dir, template = args.template.rsplit('/', 1) - netsets = NetworkSettings(args.net_settings_file, - args.network_isolation) + netsets = NetworkSettings(args.net_settings_file) env = Environment(loader=FileSystemLoader(template_dir), autoescape=True) template = env.get_template(template) @@ -132,9 +128,6 @@ def get_parser(): default='network-settings.yaml', dest='net_settings_file', help='path to network settings file') - net_settings.add_argument('--flat', action='store_false', - default=True, dest='network_isolation', - help='disable network isolation') net_settings.add_argument('-e', '--net-env-file', default="network-environment.yaml", dest='net_env_file', @@ -178,9 +171,6 @@ def get_parser(): default='network-settings.yaml', dest='net_settings_file', help='path to network settings file') - nic_template.add_argument('--flat', action='store_false', - default=True, dest='network_isolation', - help='disable network isolation') nic_template.add_argument('-e', '--ext-net-type', default='interface', dest='ext_net_type', choices=['interface', 'br-ex'], diff --git a/lib/undercloud-functions.sh b/lib/undercloud-functions.sh index 3c918502..98552f29 100755 --- a/lib/undercloud-functions.sh +++ b/lib/undercloud-functions.sh @@ -120,32 +120,31 @@ function configure_undercloud { local controller_nic_template compute_nic_template echo echo "Copying configuration files to Undercloud" - if [[ "$net_isolation_enabled" == "TRUE" ]]; then - echo -e "${blue}Network Environment set for Deployment: ${reset}" - cat $APEX_TMP_DIR/network-environment.yaml - scp ${SSH_OPTIONS[@]} $APEX_TMP_DIR/network-environment.yaml "stack@$UNDERCLOUD": - - # check for ODL L3/ONOS - if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then - ext_net_type=br-ex - fi - - if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then - ovs_dpdk_bridge='br-phy' - else - ovs_dpdk_bridge='' - fi - - if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS $net_isolation_arg -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then - echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" - exit 1 - fi + echo -e "${blue}Network Environment set for Deployment: ${reset}" + cat $APEX_TMP_DIR/network-environment.yaml + scp ${SSH_OPTIONS[@]} $APEX_TMP_DIR/network-environment.yaml "stack@$UNDERCLOUD": - if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS $net_isolation_arg -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then - echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" - exit 1 - fi - ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI + # check for ODL L3/ONOS + if [ "${deploy_options_array['sdn_l3']}" == 'True' ]; then + ext_net_type=br-ex + fi + + if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then + ovs_dpdk_bridge='br-phy' + else + ovs_dpdk_bridge='' + fi + + if ! controller_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r controller -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e "br-ex"); then + echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}" + exit 1 + fi + + if ! compute_nic_template=$(python3 -B $LIB/python/apex_python_utils.py nic-template -r compute -s $NETSETS -t $CONFIG/nics-template.yaml.jinja2 -e $ext_net_type -d "$ovs_dpdk_bridge"); then + echo -e "${red}ERROR: Failed to generate compute NIC heat template ${reset}" + exit 1 + fi + ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI mkdir nics/ cat > nics/controller.yaml << EOF $controller_nic_template @@ -154,7 +153,6 @@ cat > nics/compute.yaml << EOF $compute_nic_template EOF EOI - fi # ensure stack user on Undercloud machine has an ssh key ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" "if [ ! -e ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa; fi" @@ -189,27 +187,24 @@ EOI echo "Running undercloud configuration." echo "Logging undercloud configuration to undercloud:/home/stack/apex-undercloud-install.log" ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" << EOI -if [[ "$net_isolation_enabled" == "TRUE" ]]; then - sed -i 's/#local_ip/local_ip/' undercloud.conf - sed -i 's/#network_gateway/network_gateway/' undercloud.conf - sed -i 's/#network_cidr/network_cidr/' undercloud.conf - sed -i 's/#dhcp_start/dhcp_start/' undercloud.conf - sed -i 's/#dhcp_end/dhcp_end/' undercloud.conf - sed -i 's/#inspection_iprange/inspection_iprange/' undercloud.conf - sed -i 's/#undercloud_debug/undercloud_debug/' undercloud.conf - - openstack-config --set undercloud.conf DEFAULT local_ip ${admin_installer_vm_ip}/${admin_cidr##*/} - openstack-config --set undercloud.conf DEFAULT network_gateway ${admin_installer_vm_ip} - openstack-config --set undercloud.conf DEFAULT network_cidr ${admin_cidr} - openstack-config --set undercloud.conf DEFAULT dhcp_start ${admin_dhcp_range%%,*} - openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_dhcp_range##*,} - openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_introspection_range} - openstack-config --set undercloud.conf DEFAULT undercloud_debug false - openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.${domain_name}" - sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30 - sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40 - -fi +sed -i 's/#local_ip/local_ip/' undercloud.conf +sed -i 's/#network_gateway/network_gateway/' undercloud.conf +sed -i 's/#network_cidr/network_cidr/' undercloud.conf +sed -i 's/#dhcp_start/dhcp_start/' undercloud.conf +sed -i 's/#dhcp_end/dhcp_end/' undercloud.conf +sed -i 's/#inspection_iprange/inspection_iprange/' undercloud.conf +sed -i 's/#undercloud_debug/undercloud_debug/' undercloud.conf + +openstack-config --set undercloud.conf DEFAULT local_ip ${admin_installer_vm_ip}/${admin_cidr##*/} +openstack-config --set undercloud.conf DEFAULT network_gateway ${admin_installer_vm_ip} +openstack-config --set undercloud.conf DEFAULT network_cidr ${admin_cidr} +openstack-config --set undercloud.conf DEFAULT dhcp_start ${admin_dhcp_range%%,*} +openstack-config --set undercloud.conf DEFAULT dhcp_end ${admin_dhcp_range##*,} +openstack-config --set undercloud.conf DEFAULT inspection_iprange ${admin_introspection_range} +openstack-config --set undercloud.conf DEFAULT undercloud_debug false +openstack-config --set undercloud.conf DEFAULT undercloud_hostname "undercloud.${domain_name}" +sudo openstack-config --set /etc/ironic/ironic.conf disk_utils iscsi_verify_attempts 30 +sudo openstack-config --set /etc/ironic/ironic.conf disk_partitioner check_device_max_retries 40 sudo sed -i '/CephClusterFSID:/c\\ CephClusterFSID: \\x27$(cat /proc/sys/kernel/random/uuid)\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml sudo sed -i '/CephMonKey:/c\\ CephMonKey: \\x27'"\$(ceph-authtool --gen-print-key)"'\\x27' /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml diff --git a/tests/test_apex_network_environment.py b/tests/test_apex_network_environment.py index 7c9b922f..df0f0334 100644 --- a/tests/test_apex_network_environment.py +++ b/tests/test_apex_network_environment.py @@ -37,11 +37,11 @@ class TestNetworkEnvironment(object): def setup_class(klass): """This method is run once for each class before any tests are run""" klass.ns = NetworkSettings( - '../config/network/network_settings.yaml', True) + '../config/network/network_settings.yaml') klass.ns_vlans = NetworkSettings( - '../config/network/network_settings_vlans.yaml', True) + '../config/network/network_settings_vlans.yaml') klass.ns_ipv6 = NetworkSettings( - '../config/network/network_settings_v6.yaml', True) + '../config/network/network_settings_v6.yaml') @classmethod def teardown_class(klass): @@ -130,7 +130,7 @@ class TestNetworkEnvironment(object): ns = copy(self.ns_vlans) ns['networks'][API_NETWORK]['enabled'] = True ns['networks'][API_NETWORK]['cidr'] = '10.11.12.0/24' - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) # test vlans ne = NetworkEnvironment(ns, '../build/network-environment.yaml') assert_equal(ne['parameter_defaults']['InternalApiNetworkVlanID'], 101) @@ -138,7 +138,7 @@ class TestNetworkEnvironment(object): def test_netenv_settings_api_network_vlans(self): ns = copy(self.ns_vlans) ns['networks'][API_NETWORK]['enabled'] = True - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) # test vlans ne = NetworkEnvironment(ns, '../build/network-environment.yaml') assert_equal(ne['parameter_defaults']['InternalApiNetworkVlanID'], 101) diff --git a/tests/test_apex_network_settings.py b/tests/test_apex_network_settings.py index 47c13cc5..955c0cf7 100644 --- a/tests/test_apex_network_settings.py +++ b/tests/test_apex_network_settings.py @@ -44,12 +44,12 @@ class TestNetworkSettings(object): def test_init(self): assert_is_instance( - NetworkSettings(files_dir+'network_settings.yaml', True), + NetworkSettings(files_dir+'network_settings.yaml'), NetworkSettings) def test_init_vlans(self): assert_is_instance( - NetworkSettings(files_dir+'network_settings_vlans.yaml', True), + NetworkSettings(files_dir+'network_settings_vlans.yaml'), NetworkSettings) # TODO, v6 test is stuck @@ -59,34 +59,34 @@ class TestNetworkSettings(object): # NetworkSettings) def test_init_admin_disabled_or_missing(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove admin, apex section will re-add it ns['networks'].pop('admin', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) # remove admin and apex ns.pop('apex', None) ns['networks'].pop('admin', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_init_collapse_storage(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove storage ns['networks'].pop('storage', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_init_missing_dns_domain(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove storage ns.pop('dns-domain', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_dump_bash(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_equal(ns.dump_bash(), None) assert_equal(ns.dump_bash(path='/dev/null'), None) def test_get_network_settings(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_is_instance(ns, NetworkSettings) for role in ['controller', 'compute']: nic_index = 1 @@ -97,41 +97,41 @@ class TestNetworkSettings(object): nic_index += 1 def test_get_enabled_networks(self): - ns = NetworkSettings('../config/network/network_settings.yaml', True) + ns = NetworkSettings('../config/network/network_settings.yaml') assert_is_instance(ns.enabled_network_list, list) def test_invalid_nic_members(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') storage_net_nicmap = ns['networks'][STORAGE_NETWORK]['nic_mapping'] # set duplicate nic storage_net_nicmap['compute']['members'][0] = 'nic1' - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) # remove nic members storage_net_nicmap['compute']['members'] = [] - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_missing_vlan(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') storage_net_nicmap = ns['networks'][STORAGE_NETWORK]['nic_mapping'] # remove vlan from storage net storage_net_nicmap['compute'].pop('vlan', None) - assert_is_instance(NetworkSettings(ns, True), NetworkSettings) + assert_is_instance(NetworkSettings(ns), NetworkSettings) # TODO # need to manipulate interfaces some how # maybe for ip_utils to return something to pass this # def test_admin_auto_detect(self): -# ns = NetworkSettings(files_dir+'network_settings.yaml', True) +# ns = NetworkSettings(files_dir+'network_settings.yaml') # # remove cidr to force autodetection # ns['networks'][ADMIN_NETWORK].pop('cidr', None) -# assert_is_instance(NetworkSettings(ns, True), NetworkSettings) +# assert_is_instance(NetworkSettings(ns), NetworkSettings) def test_admin_fail_auto_detect(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # remove cidr and installer_vm to fail autodetect ns['networks'][ADMIN_NETWORK].pop('cidr', None) ns['networks'][ADMIN_NETWORK].pop('installer_vm', None) - assert_raises(NetworkSettingsException, NetworkSettings, ns, True) + assert_raises(NetworkSettingsException, NetworkSettings, ns) def test_exception(self): e = NetworkSettingsException("test") @@ -139,22 +139,22 @@ class TestNetworkSettings(object): assert_is_instance(e, NetworkSettingsException) def test_config_ip(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # set the provisioner ip to None to force _gen_ip to generate one ns['networks'][ADMIN_NETWORK]['installer_vm']['ip'] = None ns['networks'][EXTERNAL_NETWORK][0]['installer_vm']['ip'] = None # Now rebuild network settings object and check for repopulated values - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) assert_equal(ns['networks'][ADMIN_NETWORK]['installer_vm']['ip'], '192.0.2.1') assert_equal(ns['networks'][EXTERNAL_NETWORK][0]['installer_vm']['ip'], '192.168.37.1') def test_config_gateway(self): - ns = NetworkSettings(files_dir+'network_settings.yaml', True) + ns = NetworkSettings(files_dir+'network_settings.yaml') # set the gateway ip to None to force _config_gateway to generate one ns['networks'][EXTERNAL_NETWORK][0]['gateway'] = None # Now rebuild network settings object and check for a repopulated value - ns = NetworkSettings(ns, True) + ns = NetworkSettings(ns) assert_equal(ns['networks'][EXTERNAL_NETWORK][0]['gateway'], '192.168.37.1') diff --git a/tests/test_apex_python_utils_py.py b/tests/test_apex_python_utils_py.py index 28180f06..eb16f67d 100644 --- a/tests/test_apex_python_utils_py.py +++ b/tests/test_apex_python_utils_py.py @@ -62,7 +62,6 @@ class TestCommonUtils(object): tmp_dir = tempfile.mkdtemp() args = self.parser.parse_args(['parse-net-settings', '-s', net_sets, - '--flat', '-td', tmp_dir, '-e', net_env]) assert_equal(parse_net_settings(args), None) |