Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Sep 2, 2024
1 parent e2a2345 commit 363a7b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions wapi2nsconf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def guess_wapi_version(endpoint: str) -> Optional[float]:

def filter_zones(zones: List[InfobloxZone], conf: dict) -> List[InfobloxZone]:
res = []
ns_groups = conf.get("ns_groups", None)
ns_groups = conf.get("ns_groups")
extattr_key = conf.get("extattr_key")
extattr_val = conf.get("extattr_value")

Expand Down Expand Up @@ -144,8 +144,8 @@ def output_nsconf(
res = template.render(zones=zones, masters=conf.get("masters", []))

output_filename = output["filename"]
with open(output_filename, "wt") as output_file:
output_file.write(res)
with open(output_filename, "w") as fp:
fp.write(res)
logger.info("Output written to %s", output_filename)


Expand Down Expand Up @@ -195,7 +195,8 @@ def main() -> None:
logging.getLogger("requests").setLevel(logging.INFO)

try:
conf = yaml.safe_load(open(args.conf_filename, "rt"))
with open(args.conf_filename) as fp:
conf = yaml.safe_load(fp)
except FileNotFoundError:
parser.print_help()
sys.exit(0)
Expand Down
4 changes: 2 additions & 2 deletions wapi2nsconf/wapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@dataclass(frozen=True)
class InfobloxZone(object):
class InfobloxZone:
fqdn: str
disabled: bool
extattrs: dict
Expand Down Expand Up @@ -44,7 +44,7 @@ def from_wapi(cls, wzone: dict) -> Optional["InfobloxZone"]:
)


class WAPI(object):
class WAPI:
"""WAPI Client"""

def __init__(
Expand Down

0 comments on commit 363a7b4

Please sign in to comment.