From 77ba5f4553010d95438e1f40c9b731c12c90857b Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 22 May 2024 23:47:28 +0200 Subject: [PATCH 1/3] Fix pylint issues appeared with version 3.2.2 of pylint Change-Id: Iae943e2a3b26b8eed616509ec9a3a4cbc493aa6e Signed-off-by: garciadeblas --- osmclient/cli_commands/utils.py | 2 ++ osmclient/common/package_tool.py | 2 ++ osmclient/sol005/ns.py | 2 +- tox.ini | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osmclient/cli_commands/utils.py b/osmclient/cli_commands/utils.py index 9ec03f6..25fc21a 100755 --- a/osmclient/cli_commands/utils.py +++ b/osmclient/cli_commands/utils.py @@ -48,6 +48,8 @@ def check_client_version(obj, what, version="sol005"): message = f"The following commands or options are only supported with the version v1 of OSM SOL005': {what}" elif version == "sol005_v2": message = f"The following commands or options are only supported with the version v2 of OSM SOL005': {what}" + else: + message = f"The following commands or options are only supported with the version {version} of OSM SOL005': {what}" fullclassname = obj.__module__ + "." + obj.__class__.__name__ if fullclassname != "osmclient.{}.client.Client".format(version): raise ClientException(message) diff --git a/osmclient/common/package_tool.py b/osmclient/common/package_tool.py index a2cbd87..b1565ea 100644 --- a/osmclient/common/package_tool.py +++ b/osmclient/common/package_tool.py @@ -708,6 +708,8 @@ class PackageTool(object): or package_handling.SOL004_TOSCA == package_type ): the_package = SOL004Package(package_folder) + else: + raise ClientException(f"Unknown package type: {package_type}") the_package.create_or_update_metadata_file() diff --git a/osmclient/sol005/ns.py b/osmclient/sol005/ns.py index c84d090..50a1dba 100644 --- a/osmclient/sol005/ns.py +++ b/osmclient/sol005/ns.py @@ -586,7 +586,7 @@ class Ns(object): http_code, resp = self._http.get2_cmd( "{}/{}".format(self._apiBase, uuid) ) - if not uuid: + else: # if not uuid http_code, resp = self._http.get2_cmd( "{}/{}/{}/{}".format(self._apiBase, uuid, project_name, ns_id) ) diff --git a/tox.ini b/tox.ini index ee43058..607d0d3 100644 --- a/tox.ini +++ b/tox.ini @@ -64,7 +64,7 @@ commands = deps = {[testenv]deps} -r{toxinidir}/requirements-dev.txt -r{toxinidir}/requirements-test.txt - pylint + pylint==3.2.2 commands = pylint -E osmclient/ -- 2.25.1 From 8319f271198f5ac7be9164ea3349b9b6c8a459ce Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Mon, 17 Jun 2024 12:14:30 +0200 Subject: [PATCH 2/3] Remove set_default_params method from client.py Change-Id: I2da0e9f5e182870af1ca5c6eb583895e162f6db2 Signed-off-by: garciadeblas --- osmclient/sol005/client.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/osmclient/sol005/client.py b/osmclient/sol005/client.py index 5146fe2..cd67a87 100644 --- a/osmclient/sol005/client.py +++ b/osmclient/sol005/client.py @@ -147,12 +147,3 @@ class Client(object): version = resp.split()[2] date = resp.split()[4] return "{} {}".format(version, date) - - def set_default_params(self, **kwargs): - host = kwargs.pop("host", None) - if host is not None: - self._host = host - port = kwargs.pop("port", None) - if port is not None: - self._so_port = port - self._http_client.set_query_admin(**kwargs) -- 2.25.1 From 9cdadd6be32877f088455074101483194b1f5bf8 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 19 Jun 2024 10:58:48 +0200 Subject: [PATCH 3/3] Fix bug 2373 - Remove old code from v1 client in ns_show Change-Id: I4cfe351acc7c0ce092236f8f55cd369063b69181 Signed-off-by: garciadeblas --- osmclient/cli_commands/ns.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/osmclient/cli_commands/ns.py b/osmclient/cli_commands/ns.py index 80961d5..a21c492 100755 --- a/osmclient/cli_commands/ns.py +++ b/osmclient/cli_commands/ns.py @@ -307,11 +307,6 @@ def ns_show(ctx, name, literal, filter, output): if not filter or k in filter: table.add_row([k, utils.wrap_text(text=json.dumps(v, indent=2), width=100)]) - nsopdata = ctx.obj.ns.get_opdata(ns["id"]) - nsr_optdata = nsopdata["nsr:nsr"] - for k, v in list(nsr_optdata.items()): - if not filter or k in filter: - table.add_row([k, utils.wrap_text(json.dumps(v, indent=2), width=100)]) print_output.print_output(output, table.field_names, table._rows) -- 2.25.1