Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Use f-strings and be more pythonic...

Co-authored-by: Shane Kerr <133137948+shane-ns1@users.noreply.github.com>
  • Loading branch information
hhellyer and shane-ns1 authored Oct 29, 2024
1 parent 5343372 commit 27a205a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ns1/rest/zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 27a205a

Please sign in to comment.