summaryrefslogtreecommitdiffstats
path: root/deploy/post/neutron.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-03 18:34:16 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-06 09:12:58 +0800
commitd4b8505d4fef4a0ff650653a3056327f866d70fd (patch)
treeecb5ef33071474ca8ff66f12c30c1b69467dfa9f /deploy/post/neutron.py
parentcd585136acb636d6b13b173cf593c5f01c5f33a8 (diff)
add framework of post deploy process
Change-Id: I3f5a067a6359be482a853b164fd7effdfad8fc8f Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'deploy/post/neutron.py')
-rw-r--r--deploy/post/neutron.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/deploy/post/neutron.py b/deploy/post/neutron.py
new file mode 100644
index 00000000..0dffdfc3
--- /dev/null
+++ b/deploy/post/neutron.py
@@ -0,0 +1,25 @@
+##############################################################################
+# Copyright (c) 2017 ZTE Coreporation and others.
+# feng.xiaowei@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+from neutronclient.neutron import client as neutronclient
+
+import keystoneauth
+
+
+class Neutron(object):
+ def __init__(self, api_v='2', openrc=None):
+ session = keystoneauth.Keystoneauth(openrc).session
+ self.client = neutronclient.Client(api_v, session=session)
+
+ def list_networks(self):
+ networks = self.client.list_networks()['networks']
+ for network in networks:
+ print network
+
+ def create_admin_ext_net(self):
+ pass