From 27a205a566f512835056797d745dda7caa90bb3d Mon Sep 17 00:00:00 2001 From: Howard Hellyer Date: Tue, 29 Oct 2024 15:31:55 +0000 Subject: [PATCH] Apply suggestions from code review Use f-strings and be more pythonic... Co-authored-by: Shane Kerr <133137948+shane-ns1@users.noreply.github.com> --- ns1/rest/zones.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ns1/rest/zones.py b/ns1/rest/zones.py index 0cb8890..581a30e 100644 --- a/ns1/rest/zones.py +++ b/ns1/rest/zones.py @@ -43,7 +43,7 @@ def import_file( params = self._buildImportParams(kwargs) return self._make_request( "PUT", - "import/zonefile/{}".format(zone), + f"import/zonefile/{zone}", files=files, params=params, callback=callback, @@ -57,7 +57,7 @@ def _buildImportParams(self, fields): # parameter but the zonefile API expects parameters containing comma # seperated values. if fields.get("networks") is not None: - networks_strs = map(str, fields["networks"]) + networks_strs = [str(network) for network in fields["networks"]] networks_param = ",".join(networks_strs) params["networks"] = networks_param if fields.get("views") is not None: @@ -73,7 +73,7 @@ def create(self, zone, callback=None, errback=None, name=None, **kwargs): name = zone return self._make_request( "PUT", - "{}/{}".format(self.ROOT, name), + f"{self.ROOT}/{name}", body=body, callback=callback, errback=errback,