diff options
author | Zhijiang Hu <hu.zhijiang@zte.com.cn> | 2017-03-09 08:04:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-09 08:04:09 +0000 |
commit | ad7a882c71c0ed779b2111f400ac6b8bd108e4c5 (patch) | |
tree | 769365763a1b7f2a8bbf9d2a4b703a3523c462d7 /deploy/post/execute.py | |
parent | f9385eec67ad616ed3776d8800f3bc1f93e999c5 (diff) | |
parent | 2a5cc313b0780bed2750229bf42eab39da6d49a8 (diff) |
Merge "create admin external subnet"
Diffstat (limited to 'deploy/post/execute.py')
-rw-r--r-- | deploy/post/execute.py | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/deploy/post/execute.py b/deploy/post/execute.py index 3f05d005..d5a0727b 100644 --- a/deploy/post/execute.py +++ b/deploy/post/execute.py @@ -25,9 +25,29 @@ def _config_admin_external_network(): return name, body +def _config_admin_external_subnet(nid): + return { + 'subnets': [ + { + 'name': 'admin_external_subnet', + 'cidr': '172.10.101.0/24', + 'ip_version': 4, + 'network_id': nid, + 'gateway_ip': '172.10.101.1', + 'allocation_pools': [{ + 'start': '172.10.101.2', + 'end': '172.10.101.12' + }], + 'enable_dhcp': False + } + ] + } + + def main(): - neutron.Neutron().list_networks() - neutron.Neutron().create_network(*(_config_admin_external_network())) + neutronclient = neutron.Neutron() + nid = neutronclient.create_network(*(_config_admin_external_network())) + neutronclient.create_subnet(_config_admin_external_subnet(nid)) if __name__ == '__main__': main() |