Skip to content

Commit

Permalink
modify commands using utilities_common.cli.run_command and advance so…
Browse files Browse the repository at this point in the history
…nic-utilities submodule on master (sonic-net#15193)

Dependency:
sonic-net/sonic-utilities#2718

Why I did it
This PR sonic-net/sonic-utilities#2718 reduce shell=True usage in utilities_common.cli.run_command() function.

Work item tracking
Microsoft ADO (number only): 15022050
How I did it
Replace strings commands using utilities_common.cli.run_command() function to list of strings

due to circular dependency, advance sonic-utilities submodule
72ca4848 (HEAD -> master, upstream/master, upstream/HEAD) Add CLI configuration options for teamd retry count feature (sonic-net/sonic-utilities#2642)
359dfc0c [Clock] Implement clock CLI (sonic-net/sonic-utilities#2793)
b316fc27 Add transceiver status CLI to show output from TRANSCEIVER_STATUS table (sonic-net/sonic-utilities#2772)
dc59dbd2 Replace pickle by json (sonic-net/sonic-utilities#2849)
a66f41c4 [show] replace shell=True, replace xml by lxml, replace exit by sys.exit (sonic-net/sonic-utilities#2666)
57500572 [utilities_common] replace shell=True (sonic-net/sonic-utilities#2718)
6e0ee3e7 [CRM][DASH] Extend CRM utility to support DASH resources. (sonic-net/sonic-utilities#2800)
b2c29b0b [config] Generate sysinfo in single asic (sonic-net/sonic-utilities#2856)
  • Loading branch information
maipbui authored and sonic-otn committed Sep 20, 2023
1 parent 2ad7192 commit 41da53d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dockers/docker-dhcp-relay/cli/config/plugins/dhcp_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def restart_dhcp_relay_service():
Restart dhcp_relay service
"""
click.echo("Restarting DHCP relay service...")
clicommon.run_command("systemctl stop dhcp_relay", display_cmd=False)
clicommon.run_command("systemctl reset-failed dhcp_relay", display_cmd=False)
clicommon.run_command("systemctl start dhcp_relay", display_cmd=False)
clicommon.run_command(['systemctl', 'stop', 'dhcp_relay'], display_cmd=False)
clicommon.run_command(['systemctl', 'reset-failed', 'dhcp_relay'], display_cmd=False)
clicommon.run_command(['systemctl', 'start', 'dhcp_relay'], display_cmd=False)


def add_dhcp_relay(vid, dhcp_relay_ips, db, ip_version):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def macsec_clear_counters(clean_cache):
print("Cleaned cache")
return

clicommon.run_command("show macsec --dump-file")
clicommon.run_command(['show', 'macsec', '--dump-file'])
print("Clear MACsec counters")

def register(cli):
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-utilities

0 comments on commit 41da53d

Please sign in to comment.