summaryrefslogtreecommitdiffstats
path: root/vnfmgr/vnfmgr_main.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-11-15 00:18:32 +0100
committerjose.lausuch <jose.lausuch@ericsson.com>2016-11-15 00:20:33 +0100
commit73c4d745bf2bba060dc8301a9127482f01318de1 (patch)
treed0f37c2e819b518f952dcfe743672f2be45685d4 /vnfmgr/vnfmgr_main.py
parent55649ff33c7c92a0ba2d08ebf15a21f3df9ae781 (diff)
Fix all the flake8 violations in the repo
Change-Id: I05109298835c26a1927a490f8c21dd2ca7f77947 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'vnfmgr/vnfmgr_main.py')
-rwxr-xr-xvnfmgr/vnfmgr_main.py57
1 files changed, 31 insertions, 26 deletions
diff --git a/vnfmgr/vnfmgr_main.py b/vnfmgr/vnfmgr_main.py
index b5ab8be1..21941b0d 100755
--- a/vnfmgr/vnfmgr_main.py
+++ b/vnfmgr/vnfmgr_main.py
@@ -1,11 +1,11 @@
#################################################################
-# #
-# Copyright 2015 Ericsson AB #
-# All Rights Reserved #
-# #
-# Author: Manuel Buil <Manuel.Buil@ericsson.com> #
-# Version: 0.1 #
-# #
+#
+# Copyright 2015 Ericsson AB
+# All Rights Reserved
+#
+# Author: Manuel Buil <Manuel.Buil@ericsson.com>
+# Version: 0.1
+#
#################################################################
import pdb
@@ -15,7 +15,7 @@ import time
import json
if __name__ == "__main__":
- #OpenStack environment information
+ # OpenStack environment information
authurl = "http://localhost:5000/v2.0"
adminTenantName = 'admin'
adminTenantUser = 'admin'
@@ -30,7 +30,7 @@ if __name__ == "__main__":
# Provide the file with the SFC configuration
file_json = "vnfmgr_odl/sample_config/RestConf-SFCs-HttpPut.json"
# Read the config files which refer to SF
- json_data=open(file_json).read()
+ json_data = open(file_json).read()
data = json.loads(json_data)
pdb.set_trace()
@@ -41,32 +41,37 @@ if __name__ == "__main__":
for SF in SFs:
sf_type = SF['type']
name = SF['name']
- #2 - Search the image in glance with that SF type
+ # 2 - Search the image in glance with that SF type
image = openstack.find_image(sf_type)
- if image == None:
+ if image is None:
print("There is no image with that sf_name")
exit(1)
# 3 - Boot the VM without network
flavor = 1
print("About to deploy")
- vm = openstack.create_vm(name,image,flavor)
- if vm == None:
+ vm = openstack.create_vm(name, image, flavor)
+ if vm is None:
print("Problems to deploy the VM")
exit(1)
-
- #Make the call to ODL to deploy SFC
+
+ # Make the call to ODL to deploy SFC
context = odlscript.Context()
context.set_path_prefix_paths("vnfmgr_odl/sample_config")
pdb.set_trace()
- odlscript.send_rest(context, "PUT", context.rest_url_sf_sel, context.rest_path_sf_sel)
- odlscript.send_rest(context, "PUT", context.rest_url_sf, context.rest_path_sf)
- odlscript.send_rest(context, "PUT", context.rest_url_sff, context.rest_path_sff)
- odlscript.send_rest(context, "PUT", context.rest_url_sfc, context.rest_path_sfc)
- odlscript.send_rest(context, "PUT", context.rest_url_sfp, context.rest_path_sfp)
- time.sleep(1);
- odlscript.send_rest(context, "POST", context.rest_url_rsp_rpc, context.rest_path_rsp)
-
+ odlscript.send_rest(
+ context, "PUT", context.rest_url_sf_sel, context.rest_path_sf_sel)
+ odlscript.send_rest(
+ context, "PUT", context.rest_url_sf, context.rest_path_sf)
+ odlscript.send_rest(
+ context, "PUT", context.rest_url_sff, context.rest_path_sff)
+ odlscript.send_rest(
+ context, "PUT", context.rest_url_sfc, context.rest_path_sfc)
+ odlscript.send_rest(
+ context, "PUT", context.rest_url_sfp, context.rest_path_sfp)
+ time.sleep(1)
+ odlscript.send_rest(
+ context, "POST", context.rest_url_rsp_rpc, context.rest_path_rsp)
- #TO DO
- # Check if the SF_VM already exists before creating it
- # Network of the VM
+ # TO DO
+ # Check if the SF_VM already exists before creating it
+ # Network of the VM