Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wenchungw committed Sep 19, 2024
1 parent 9e3b184 commit 31840f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions scripts/dpu_tty.py → scripts/dpu-tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
UART_CON = '/usr/bin/picocom'


def get_dpu_tty(dpu_id, tty, baud):
def get_dpu_tty(dpu, tty, baud):

platform = device_info.get_platform()
if not platform:
Expand All @@ -37,8 +37,6 @@ def get_dpu_tty(dpu_id, tty, baud):
print("No DPUs in platform.json")
return None

dpu = 'dpu' + str(dpu_id)

if tty is None:
dev = dpus[dpu]["serial-console"]["device"]
else:
Expand All @@ -53,12 +51,12 @@ def get_dpu_tty(dpu_id, tty, baud):
def main():

parser = argparse.ArgumentParser(description='DPU TTY Console Utility')
parser.add_argument('-s', '--slot', type=int, required=True)
parser.add_argument('-n', '--name', required=True)
parser.add_argument('-t', '--tty')
parser.add_argument('-b', '--baud', type=int)
parser.add_argument('-b', '--baud')
args = parser.parse_args()

dpu_tty, dpu_baud = get_dpu_tty(args.slot, args.tty, args.baud)
dpu_tty, dpu_baud = get_dpu_tty(args.name, args.tty, args.baud)
# Use UART console utility for error checking of dpu_tty and dpu_baud.

p = subprocess.run([UART_CON, '-b', dpu_baud, '/dev/%s' % dpu_tty])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
'scripts/decode-syseeprom',
'scripts/dropcheck',
'scripts/disk_check.py',
'scripts/dpu_tty.py',
'scripts/dpu-tty.py',
'scripts/dropconfig',
'scripts/dropstat',
'scripts/dualtor_neighbor_check.py',
Expand Down

0 comments on commit 31840f3

Please sign in to comment.