diff options
author | zhongjun <zhong.jun@zte.com.cn> | 2017-04-27 22:15:40 +0800 |
---|---|---|
committer | zhongjun <zhong.jun@zte.com.cn> | 2017-05-03 18:43:21 +0800 |
commit | a7e8ac7aa6cf5bdefb80fdd051a2162b4f7d6108 (patch) | |
tree | ab855ce492530441d80968d27cb809e262eaa2de /deploy/post/execute.py | |
parent | 17db096d1bbbaabd30add632fc91e4e48afc990f (diff) |
Hardcoded physnet1 changed to obtain from .yml
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>
Diffstat (limited to 'deploy/post/execute.py')
-rw-r--r-- | deploy/post/execute.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/deploy/post/execute.py b/deploy/post/execute.py index d310acbc..37a67b4c 100644 --- a/deploy/post/execute.py +++ b/deploy/post/execute.py @@ -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)) |