From f6a4f77b98e5f05b74938b44bcbb2ed148e4941a Mon Sep 17 00:00:00 2001 From: Felipe Vicens Date: Thu, 14 May 2020 09:36:21 +0200 Subject: [PATCH] Fix #1063 flake tests osmclient is failing in jenkins merge stage due flake check Change-Id: I25f8940e000949176798c14207b7801434c7ff35 Signed-off-by: Felipe Vicens --- osmclient/common/package_tool.py | 4 ++-- osmclient/sol005/k8scluster.py | 2 +- osmclient/sol005/ns.py | 2 +- osmclient/sol005/nsi.py | 2 +- osmclient/sol005/pdud.py | 2 +- osmclient/sol005/repo.py | 2 +- osmclient/sol005/user.py | 2 +- osmclient/sol005/vnfd.py | 2 +- osmclient/sol005/wim.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/osmclient/common/package_tool.py b/osmclient/common/package_tool.py index 652dbc2..d60c1d0 100644 --- a/osmclient/common/package_tool.py +++ b/osmclient/common/package_tool.py @@ -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)) diff --git a/osmclient/sol005/k8scluster.py b/osmclient/sol005/k8scluster.py index 0cdb089..4ac2e48 100644 --- a/osmclient/sol005/k8scluster.py +++ b/osmclient/sol005/k8scluster.py @@ -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)) diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index 4798bf3..b551868 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -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)) diff --git a/osmclient/sol005/nsi.py b/osmclient/sol005/nsi.py index 4671441..be1deea 100644 --- a/osmclient/sol005/nsi.py +++ b/osmclient/sol005/nsi.py @@ -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)) diff --git a/osmclient/sol005/pdud.py b/osmclient/sol005/pdud.py index 3abb78c..aa4bf69 100644 --- a/osmclient/sol005/pdud.py +++ b/osmclient/sol005/pdud.py @@ -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: diff --git a/osmclient/sol005/repo.py b/osmclient/sol005/repo.py index 7a31397..cc82402 100644 --- a/osmclient/sol005/repo.py +++ b/osmclient/sol005/repo.py @@ -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)) diff --git a/osmclient/sol005/user.py b/osmclient/sol005/user.py index 1584878..d28514e 100644 --- a/osmclient/sol005/user.py +++ b/osmclient/sol005/user.py @@ -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) diff --git a/osmclient/sol005/vnfd.py b/osmclient/sol005/vnfd.py index 8307088..48fbdb7 100644 --- a/osmclient/sol005/vnfd.py +++ b/osmclient/sol005/vnfd.py @@ -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') diff --git a/osmclient/sol005/wim.py b/osmclient/sol005/wim.py index 0ba8ab4..5da3941 100644 --- a/osmclient/sol005/wim.py +++ b/osmclient/sol005/wim.py @@ -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)) -- 2.25.1