summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-09-26 02:12:23 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-26 02:12:23 +0000
commit4560b872fdfdc0800fd571efc35a0036ab2241b3 (patch)
tree7e5de8f3fa31d2291c2a2341462e06c25ece2ef1 /deploy
parentfcbe5420d31bf04b1d8bdf47994c174795718e66 (diff)
parentfc12fe83562430bc406877583111ed725d08edc8 (diff)
Merge "Add some unittest files such as test_nova.py"
Diffstat (limited to 'deploy')
-rw-r--r--deploy/post/execute.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/deploy/post/execute.py b/deploy/post/execute.py
index 75abaacb..fe4185b8 100644
--- a/deploy/post/execute.py
+++ b/deploy/post/execute.py
@@ -59,20 +59,20 @@ def _config_external_subnet(ext_id, network_conf):
}
-def _create_external_network(network_file):
+def _create_external_network(network_file, openrc=None):
network_conf = NetworkConfig(network_file=network_file)
ext_name = network_conf.ext_network_name
physnet = network_conf.ext_mapping if hasattr(network_conf, 'ext_mapping') else 'physnet1'
- neutronclient = neutron.Neutron()
+ neutronclient = neutron.Neutron(openrc=openrc)
ext_id = neutronclient.create_network(ext_name,
_config_external_network(ext_name, physnet))
if ext_id:
neutronclient.create_subnet(_config_external_subnet(ext_id, network_conf))
-def _create_flavor_m1_micro():
+def _create_flavor_m1_micro(openrc=None):
name = 'm1.micro'
- novaclient = nova.Nova()
+ novaclient = nova.Nova(openrc=openrc)
if not novaclient.get_flavor_by_name(name):
try:
return novaclient.create_flavor(name, ram=64, vcpus=1, disk=0)
@@ -118,8 +118,8 @@ def _prepare_cirros():
return img
-def _create_image_TestVM():
- glanceclient = glance.Glance()
+def _create_image_TestVM(openrc=None):
+ glanceclient = glance.Glance(openrc=openrc)
image = 'TestVM'
if not glanceclient.get_by_name(image):
try:
@@ -162,8 +162,8 @@ def _config_ssh_security_group_rule(security_group_id):
return body
-def _create_security_group_rules():
- neutronclient = neutron.Neutron()
+def _create_security_group_rules(openrc=None):
+ neutronclient = neutron.Neutron(openrc=openrc)
try:
security_group_name = 'default'
security_group = neutronclient.get_security_group_by_name(security_group_name)