Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: kimpaller <[email protected]>
  • Loading branch information
kimpaller committed Aug 14, 2023
1 parent 4e9a35f commit 453f967
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nebula/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
configs = None

configs = common.multi_device_check(configs, board_name)

self.power = None
if "pdu-config" in configs:
self.power = pdu(yamlfilename=configfilename, board_name=board_name)
Expand Down
12 changes: 6 additions & 6 deletions nebula/network.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import logging
import os
import pathlib
Expand All @@ -6,7 +7,6 @@
import string
import subprocess
import time
import datetime as dt

import fabric
import nebula.errors as ne
Expand Down Expand Up @@ -141,7 +141,7 @@ def run_ssh_command(
ignore_exceptions=False,
retries=3,
show_log=True,
print_result_to_file=True
print_result_to_file=True,
):
result = None
filename = None
Expand All @@ -158,22 +158,22 @@ def run_ssh_command(
raise Exception("Failed to run command:", command)

if print_result_to_file:
filename = dt.datetime.now().strftime("%Y%m%d%H%M%S")
filename = datetime.datetime.now().strftime("%Y%m%d%H%M%S")

if show_log and result.stdout:
log.info("result stdout begin -------------------------------")
log.info(f"{result.stdout}")
log.info("result stdout end -------------------------------")
if print_result_to_file:
with open(f"{self.board_name}_out_{filename}.log","w") as f:
with open(f"{self.board_name}_out_{filename}.log", "w") as f:
f.write(result.stdout)

if show_log and result.stderr:
log.info("result stderr begin -------------------------------")
log.info(f"{result.stderr}")
log.info("result stderr end -------------------------------")
if print_result_to_file:
with open(f"{self.board_name}_err_{filename}.log","w") as f:
with open(f"{self.board_name}_err_{filename}.log", "w") as f:
f.write(result.stderr)
break
except Exception as ex:
Expand Down
6 changes: 3 additions & 3 deletions nebula/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,15 +1214,15 @@ def restart_board(
user=None,
password=None,
yamlfilename="/etc/default/nebula",
board_name=None
board_name=None,
):
"""Reboot development system over IP"""
n = nebula.network(
dutip=ip,
dutusername=user,
dutpassword=password,
yamlfilename=yamlfilename,
board_name=board_name
board_name=board_name,
)
n.reboot_board(bypass_sleep=True)

Expand Down Expand Up @@ -1308,7 +1308,7 @@ def run_command(
dutusername=user,
dutpassword=password,
yamlfilename=yamlfilename,
board_name=board_name
board_name=board_name,
)
n.run_ssh_command(command, ignore_exception, retries)

Expand Down

0 comments on commit 453f967

Please sign in to comment.