summaryrefslogtreecommitdiffstats
path: root/deploy/post/execute.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-07 14:36:03 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-07 14:40:36 +0800
commit2a5cc313b0780bed2750229bf42eab39da6d49a8 (patch)
tree18474a638e53af60c814f490edc50bf959b5b166 /deploy/post/execute.py
parent010d2c95261820add617047a030e4d06563a6613 (diff)
create admin external subnet
Change-Id: Ib56c94c090fd2fc0950ce97e1c4c1fdf622f2d08 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'deploy/post/execute.py')
-rw-r--r--deploy/post/execute.py24
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()