From: garciadeblas Date: Wed, 22 May 2024 21:47:28 +0000 (+0200) Subject: Fix pylint issues appeared with version 3.2.2 of pylint X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=77ba5f4553010d95438e1f40c9b731c12c90857b;p=osm%2Fosmclient.git Fix pylint issues appeared with version 3.2.2 of pylint Change-Id: Iae943e2a3b26b8eed616509ec9a3a4cbc493aa6e Signed-off-by: garciadeblas --- 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/