Skip to content

Commit

Permalink
CI: They be linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc committed Jul 6, 2023
1 parent 56fdc6c commit ca65b22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions anta/cli/exec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ async def collect(dev: AntaDevice, command: str, outformat: Literal["json", "tex
logger.error(f"Could not collect commands on device {dev.name}: {exc_to_str(c.failed)}")
return
if c.ofmt == "json":
outfile = outdir / (command + ".json")
outfile = outdir / f"{command}.json"
content = json.dumps(c.json_output, indent=2)
elif c.ofmt == "text":
outfile = outdir / (command + ".log")
outfile = outdir / f"{command}.log"
content = c.text_output
with outfile.open(mode="w", encoding="UTF-8") as f:
f.write(content)
Expand All @@ -88,7 +88,7 @@ async def collect(dev: AntaDevice, command: str, outformat: Literal["json", "tex
if __DEBUG__:
logger.exception(message, exc_info=r)
else:
logger.error(message + f": {exc_to_str(r)}")
logger.error(f"{message}: {exc_to_str(r)}")


async def collect_scheduled_show_tech(inv: AntaInventory, root_dir: Path, configure: bool, tags: Optional[List[str]] = None, latest: Optional[int] = None) -> None:
Expand Down Expand Up @@ -150,7 +150,7 @@ async def collect(device: AntaDevice) -> None:
if __DEBUG__:
logger.exception(message)
else:
logger.error(message + f": {exc_to_str(e)}")
logger.error(f"{message}: {exc_to_str(e)}")

logger.info("Connecting to devices...")
await inv.connect_inventory()
Expand Down
2 changes: 1 addition & 1 deletion anta/inventory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ async def connect_inventory(self) -> None:
if __DEBUG__:
logger.exception(message, exc_info=r)
else:
logger.error(message + f": {exc_to_str(r)}")
logger.error(f"{message}: {exc_to_str(r)}")
1 change: 0 additions & 1 deletion anta/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def update_progress(self) -> None:
nrfu_task: TaskID = cast(TaskID, 0)
self.progress.update(nrfu_task, advance=1)


@abstractmethod
def test(self) -> Coroutine[Any, Any, TestResult]:
"""
Expand Down

0 comments on commit ca65b22

Please sign in to comment.