Hardcoded physnet1 changed to obtain from .yml 65/33965/5
authorzhongjun <zhong.jun@zte.com.cn>
Thu, 27 Apr 2017 14:15:40 +0000 (22:15 +0800)
committerzhongjun <zhong.jun@zte.com.cn>
Wed, 3 May 2017 10:43:21 +0000 (18:43 +0800)
the physical network device of external network is hardcode to
'physnet1',change it to obtain from network.yml configuration
file.

Change-Id: Id2e45ac488619db2247e73cc3fed5706db31d9e9
Signed-off-by: zhongjun <zhong.jun@zte.com.cn>
ci/deploy/deploy.sh
deploy/config/vm_environment/zte-virtual1/network.yml
deploy/config/vm_environment/zte-virtual2/network.yml
deploy/post/execute.py

index 75d3004..be17dfa 100755 (executable)
@@ -374,7 +374,6 @@ fi
 echo "====== deploy successfully ======"
 
 exit 0
-
 #
 # END of main
 ############################################################################
index 6c8a282..34b466a 100644 (file)
@@ -33,6 +33,7 @@ networks:
       end: 172.10.101.20\r
     name: EXTERNAL\r
     network_name: admin_external\r
+    mapping: physnet1\r
   - cidr: '10.20.11.0/24'\r
     gateway: '10.20.11.1'\r
     ip_ranges:\r
index 28d531c..9477ab9 100644 (file)
@@ -33,6 +33,7 @@ networks:
       end: 172.10.101.20\r
     name: EXTERNAL\r
     network_name: admin_external\r
+    mapping: physnet1\r
   - cidr: '10.20.11.0/24'\r
     gateway: '10.20.11.1'\r
     ip_ranges:\r
index d310acb..37a67b4 100644 (file)
@@ -16,14 +16,14 @@ import nova
 from deploy.config.network import NetworkConfig
 
 
-def _config_external_network(ext_name):
+def _config_external_network(ext_name, physnet):
     body = {
         'network': {
             'name': ext_name,
             'admin_state_up': True,
             'shared': False,
             'provider:network_type': 'flat',
-            'provider:physical_network': 'physnet1',
+            'provider:physical_network': physnet,
             'router:external': True
         }
     }
@@ -50,9 +50,10 @@ def _config_external_subnet(ext_id, network_conf):
 def _create_external_network(network_file):
     network_conf = NetworkConfig(network_file=network_file)
     ext_name = network_conf.ext_network_name
+    physnet = network_conf.ext_mapping
     neutronclient = neutron.Neutron()
     ext_id = neutronclient.create_network(ext_name,
-                                          _config_external_network(ext_name))
+                                          _config_external_network(ext_name, physnet))
     neutronclient.create_subnet(_config_external_subnet(ext_id, network_conf))