summaryrefslogtreecommitdiffstats
path: root/deploy/post/neutron.py
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-03-07 01:43:27 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-07 01:43:27 +0000
commitd222c03bc58c79d918001773639d0f81a57c86a8 (patch)
tree34ed1d7ca0ae2916c124bbcd1611343375305f0f /deploy/post/neutron.py
parentfad85bb5ecb07240f909ad812bf58c194bc10453 (diff)
parentd4b8505d4fef4a0ff650653a3056327f866d70fd (diff)
Merge "add framework of post deploy process"
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