Fix #1063 flake tests 15/8915/1
authorFelipe Vicens <felipe.vicens@atos.net>
Thu, 14 May 2020 07:36:21 +0000 (09:36 +0200)
committerFelipe Vicens <felipe.vicens@atos.net>
Thu, 14 May 2020 07:36:30 +0000 (09:36 +0200)
osmclient is failing in jenkins merge stage due flake check

Change-Id: I25f8940e000949176798c14207b7801434c7ff35
Signed-off-by: Felipe Vicens <felipe.vicens@atos.net>
osmclient/common/package_tool.py
osmclient/sol005/k8scluster.py
osmclient/sol005/ns.py
osmclient/sol005/nsi.py
osmclient/sol005/pdud.py
osmclient/sol005/repo.py
osmclient/sol005/user.py
osmclient/sol005/vnfd.py
osmclient/sol005/wim.py

index 652dbc2..d60c1d0 100644 (file)
@@ -290,7 +290,7 @@ class PackageTool(object):
                 if os.path.isdir('{}/charms/layers/{}'.format(package_folder,charmName)):
                     print('Building charm {}/charms/layers/{}'.format(package_folder, charmName))
                     self.charm_build(package_folder, charmName)
-                    print('Charm built'.format(charmName))
+                    print('Charm built {}'.format(charmName))
                 else:
                     if not os.path.isdir('{}/charms/{}'.format(package_folder,charmName)):
                         raise ClientException ('The charm: {} referenced in the descriptor file '
@@ -392,7 +392,7 @@ class PackageTool(object):
         ignore_patterns = ('.gitignore')
         ignore = shutil.ignore_patterns(ignore_patterns)
         directory_name = os.path.abspath("{}/tmp".format(package_folder))
-        os.makedirs("{}/{}".format(directory_name, os.path.basename(package_folder),exist_ok=True))
+        os.makedirs("{}/{}".format(directory_name, os.path.basename(package_folder)),exist_ok=True)
         self._logger.debug("Makedirs DONE: {}/{}".format(directory_name, os.path.basename(package_folder)))
         for item in os.listdir(package_folder):
             self._logger.debug("Item: {}".format(item))
index 0cdb089..4ac2e48 100644 (file)
@@ -135,7 +135,7 @@ class K8scluster(object):
             if resp:
                 resp = json.loads(resp)
             if not resp or '_id' not in resp:
-                raise ClientException('failed to get K8s cluster info: '.format(resp))
+                raise ClientException('failed to get K8s cluster info: {}'.format(resp))
             return resp
         except NotFound:
             raise NotFound("K8s cluster {} not found".format(name))
index 4798bf3..b551868 100644 (file)
@@ -294,7 +294,7 @@ class Ns(object):
             filter_string = ''
             if filter:
                  filter_string = '&{}'.format(filter)
-            http_code, resp = self._http.get2_cmd('{}?nsInstanceId={}'.format(
+            http_code, resp = self._http.get2_cmd('{}?nsInstanceId={}{}'.format(
                                                        self._apiBase, ns['_id'],
                                                        filter_string) )
             #print('HTTP CODE: {}'.format(http_code))
index 4671441..be1deea 100644 (file)
@@ -271,7 +271,7 @@ class Nsi(object):
             filter_string = ''
             if filter:
                 filter_string = '&{}'.format(filter)
-            http_code, resp = self._http.get2_cmd('{}?netsliceInstanceId={}'.format(
+            http_code, resp = self._http.get2_cmd('{}?netsliceInstanceId={}{}'.format(
                                                        self._apiBase, nsi['_id'],
                                                        filter_string) )
             #print('HTTP CODE: {}'.format(http_code))
index 3abb78c..aa4bf69 100644 (file)
@@ -118,7 +118,7 @@ class Pdu(object):
         if resp:
             resp = json.loads(resp)
         if not resp or 'id' not in resp:
-            raise ClientException('unexpected response from server: '.format(
+            raise ClientException('unexpected response from server: {}'.format(
                                   resp))
         print(resp['id'])
         #else:
index 7a31397..cc82402 100644 (file)
@@ -129,7 +129,7 @@ class Repo(object):
             if resp:
                 resp = json.loads(resp)
             if not resp or '_id' not in resp:
-                raise ClientException('failed to get repo info: '.format(resp))
+                raise ClientException('failed to get repo info: {}'.format(resp))
             return resp
         except NotFound:
             raise NotFound("Repo {} not found".format(name))
index 1584878..d28514e 100644 (file)
@@ -201,7 +201,7 @@ class User(object):
         filter_string = ''
         if filter:
             filter_string = '?{}'.format(filter)
-        _, resp = self._http.get2_cmd('{}{}'.format(self._apiBase,filter_string,skip_query_admin=True))
+        _, resp = self._http.get2_cmd('{}{}'.format(self._apiBase,filter_string), skip_query_admin=True)
         #print('RESP: {}'.format(resp))
         if resp:
             return json.loads(resp)
index 8307088..48fbdb7 100644 (file)
@@ -253,7 +253,7 @@ class Vnfd(object):
                 if resp:
                     resp = json.loads(resp)
                 if not resp or 'id' not in resp:
-                     raise ClientException('unexpected response from server: '.format(resp))
+                     raise ClientException('unexpected response from server: {}'.format(resp))
                 print(resp['id'])
             elif http_code == 204:
                 print('Updated')
index 0ba8ab4..5da3941 100644 (file)
@@ -236,7 +236,7 @@ class Wim(object):
             if resp:
                 resp =  json.loads(resp)
             if not resp or '_id' not in resp:
-                raise ClientException('failed to get wim info: '.format(resp))
+                raise ClientException('failed to get wim info: {}'.format(resp))
             return resp
         except NotFound:
             raise NotFound("wim '{}' not found".format(name))