Fix vfc-lcm/pub/msapi pep8 issue
[vfc/nfvo/lcm.git] / lcm / pub / msapi / sdc.py
index 76f0d0c..d4b513e 100644 (file)
@@ -22,21 +22,23 @@ from lcm.pub.config.config import SDC_BASE_URL, SDC_USER, SDC_PASSWD
 
 logger = logging.getLogger(__name__)
 
-ASSETTYPE_RESOURCES = "resources" 
+ASSETTYPE_RESOURCES = "resources"
 ASSETTYPE_SERVICES = "services"
 
+
 def call_sdc(resource, method, content=''):
     additional_headers = {
         'X-ECOMP-InstanceID': 'VFC',
     }
-    return restcall.call_req(base_url=SDC_BASE_URL, 
-        user=SDC_USER, 
-        passwd=SDC_PASSWD, 
-        auth_type=restcall.rest_no_auth, 
-        resource=resource, 
-        method=method, 
-        content=content,
-        additional_headers=additional_headers)
+    return restcall.call_req(base_url=SDC_BASE_URL,
+                             user=SDC_USER,
+                             passwd=SDC_PASSWD,
+                             auth_type=restcall.rest_no_auth,
+                             resource=resource,
+                             method=method,
+                             content=content,
+                             additional_headers=additional_headers)
+
 
 """
 sample of return value
@@ -55,6 +57,8 @@ sample of return value
     }
 ]
 """
+
+
 def get_artifacts(asset_type):
     resource = "/sdc/v1/catalog/{assetType}"
     resource = resource.format(assetType=asset_type)
@@ -64,6 +68,7 @@ def get_artifacts(asset_type):
         raise NSLCMException("Failed to query artifacts(%s) from sdc." % asset_type)
     return json.JSONDecoder().decode(ret[1])
 
+
 def get_artifact(asset_type, csar_id):
     artifacts = get_artifacts(asset_type)
     for artifact in artifacts:
@@ -71,6 +76,7 @@ def get_artifact(asset_type, csar_id):
             return artifact
     raise NSLCMException("Failed to query artifact(%s,%s) from sdc." % (asset_type, csar_id))
 
+
 def delete_artifact(asset_type, asset_id, artifact_id):
     resource = "/sdc/v1/catalog/{assetType}/{uuid}/artifacts/{artifactUUID}"
     resource = resource.format(assetType=asset_type, uuid=asset_id, artifactUUID=artifact_id)
@@ -80,18 +86,19 @@ def delete_artifact(asset_type, asset_id, artifact_id):
         raise NSLCMException("Failed to delete artifacts(%s) from sdc." % artifact_id)
     return json.JSONDecoder().decode(ret[1])
 
+
 def download_artifacts(download_url, local_path, file_name):
     additional_headers = {
         'X-ECOMP-InstanceID': 'VFC',
         'accept': 'application/octet-stream'
     }
-    ret = restcall.call_req(base_url=SDC_BASE_URL, 
-        user=SDC_USER, 
-        passwd=SDC_PASSWD, 
-        auth_type=rest_no_auth, 
-        resource=download_url, 
-        method="GET",
-        additional_headers=additional_headers)
+    ret = restcall.call_req(base_url=SDC_BASE_URL,
+                            user=SDC_USER,
+                            passwd=SDC_PASSWD,
+                            auth_type=restcall.rest_no_auth,
+                            resource=download_url,
+                            method="GET",
+                            additional_headers=additional_headers)
     if ret[0] != 0:
         logger.error("Status code is %s, detail is %s.", ret[2], ret[1])
         raise NSLCMException("Failed to download %s from sdc." % download_url)
@@ -100,14 +107,3 @@ def download_artifacts(download_url, local_path, file_name):
     local_file.write(ret[1])
     local_file.close()
     return local_file_name
-
-    
-
-    
-
-
-   
-
-
-
-