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 (#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 Jun 5, 2023
1 parent 2905107 commit 1477f77
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
Submodule sonic-utilities updated 71 files
+8 −8 clear/main.py
+334 −190 config/main.py
+4 −4 config/plugins/mlnx.py
+4 −4 config/syslog.py
+12 −13 config/vlan.py
+155 −0 crm/dash_config.py
+119 −0 crm/dash_show.py
+133 −17 crm/main.py
+340 −1 doc/Command-Reference.md
+7 −7 scripts/dropstat
+31 −1 scripts/fast-reboot
+5 −5 scripts/flow_counters_stat
+32 −32 scripts/intfstat
+31 −31 scripts/pfcstat
+4 −4 scripts/pg-drop
+119 −120 scripts/portstat
+17 −17 scripts/queuestat
+76 −1 scripts/sfpshow
+4 −4 scripts/sonic-bootchart
+322 −0 scripts/teamd_increase_retry_count.py
+20 −20 scripts/tunnelstat
+1 −0 setup.py
+5 −5 show/acl.py
+8 −9 show/bgp_quagga_v4.py
+6 −5 show/bgp_quagga_v6.py
+10 −10 show/chassis_modules.py
+6 −6 show/dropcounters.py
+8 −8 show/fabric.py
+10 −10 show/flow_counters.py
+2 −2 show/gearbox.py
+87 −64 show/interfaces/__init__.py
+6 −6 show/kdump.py
+167 −141 show/main.py
+15 −14 show/nat.py
+13 −13 show/platform.py
+3 −3 show/processes.py
+3 −3 show/system_health.py
+3 −3 show/vxlan.py
+7 −7 tests/chassis_modules_test.py
+33 −0 tests/clear_test.py
+1 −1 tests/config_int_ip_test.py
+458 −34 tests/config_test.py
+1 −1 tests/conftest.py
+55 −0 tests/crm_dash/config_db.json
+54 −0 tests/crm_dash/counters_db.json
+150 −0 tests/crm_dash_test.py
+1 −1 tests/ecn_test.py
+8 −8 tests/fabricstat_test.py
+25 −25 tests/fdbshow_test.py
+7 −7 tests/flow_counter_stats_test.py
+26 −4 tests/intfstat_test.py
+295 −1 tests/mock_tables/state_db.json
+10 −10 tests/multi_asic_intfutil_test.py
+2 −2 tests/multi_asic_queue_counter_test.py
+7 −7 tests/pfcstat_test.py
+175 −0 tests/portchannel_test.py
+25 −25 tests/portstat_test.py
+3 −3 tests/queue_counter_test.py
+353 −10 tests/sfp_test.py
+5 −2 tests/sfputil_test.py
+10 −10 tests/show_ip_int_test.py
+5 −5 tests/show_platform_test.py
+864 −23 tests/show_test.py
+2 −2 tests/sonic_bootchart_test.py
+7 −7 tests/techsupport_test.py
+2 −2 tests/tunnelstat_test.py
+1 −1 tests/utils.py
+6 −6 tests/vlan_test.py
+3 −5 utilities_common/bgp_util.py
+27 −20 utilities_common/cli.py
+299 −0 utilities_common/sfp_helper.py

0 comments on commit 1477f77

Please sign in to comment.