aboutsummaryrefslogtreecommitdiffstats
path: root/src/onapsdk/sdc/sdc_element.py
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2023-10-27 13:26:12 +0200
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2023-10-27 13:26:12 +0200
commit4bdb9d7a9e6b0087332a61125d544a95e695cb8b (patch)
tree6e511ab58181713c3aa10d465110def7197e9a54 /src/onapsdk/sdc/sdc_element.py
parentf2b1b5ed7fb348eb7c7f065840afaffc8cbec557 (diff)
Use latest pylint and make fixes for it
Do not be sticked into one version of pylint, but use the latest Issue-ID: INT-404 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: Ib2c0a2ebe680968ae9d69958a564733a76990367
Diffstat (limited to 'src/onapsdk/sdc/sdc_element.py')
-rw-r--r--src/onapsdk/sdc/sdc_element.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/onapsdk/sdc/sdc_element.py b/src/onapsdk/sdc/sdc_element.py
index 8fd8da1..70abadd 100644
--- a/src/onapsdk/sdc/sdc_element.py
+++ b/src/onapsdk/sdc/sdc_element.py
@@ -40,8 +40,7 @@ class SdcElement(SdcOnboardable, ABC):
"""
if self.created():
- url = "{}/items/{}/versions".format(self._base_url(),
- self.identifier)
+ url = f"{self._base_url()}/items/{self.identifier}/versions"
results: Dict[str, Any] = self.send_message_json('GET', 'get item', url)
if results["listCount"] > 1:
items: List[Dict[str, Any]] = results["results"]
@@ -89,7 +88,7 @@ class SdcElement(SdcOnboardable, ABC):
str: the base url
"""
- return "{}/sdc1/feProxy/onboarding-api/v1.0".format(cls.base_front_url)
+ return f"{cls.base_front_url}/sdc1/feProxy/onboarding-api/v1.0"
@classmethod
def _base_create_url(cls) -> str:
@@ -100,7 +99,7 @@ class SdcElement(SdcOnboardable, ABC):
str: the base url
"""
- return "{}/sdc1/feProxy/onboarding-api/v1.0".format(cls.base_front_url)
+ return f"{cls.base_front_url}/sdc1/feProxy/onboarding-api/v1.0"
def _generate_action_subpath(self, action: str) -> str:
"""
@@ -127,7 +126,7 @@ class SdcElement(SdcOnboardable, ABC):
str: the end of the path
"""
- return "{}/versions/{}".format(self.identifier, self.version)
+ return f"{self.identifier}/versions/{self.version}"
def _action_url(self, base: str, subpath: str, version_path: str,
action_type: str = None) -> str:
@@ -145,8 +144,8 @@ class SdcElement(SdcOnboardable, ABC):
"""
if action_type == const.ARCHIVE:
- version_path = version_path.split("/")[0]
- return "{}/{}/{}/actions".format(base, subpath, version_path)
+ version_path = version_path.split("/", maxsplit=1)[0]
+ return f"{base}/{subpath}/{version_path}/actions"
@classmethod
def _get_objects_list(cls, result: List[Dict[str, Any]]
@@ -172,7 +171,7 @@ class SdcElement(SdcOnboardable, ABC):
str: the url
"""
- return "{}/{}".format(cls._base_url(), cls._sdc_path())
+ return f"{cls._base_url()}/{cls._sdc_path()}"
@property
def delete_url(self) -> str: