Skip to content

Commit e4a5e4c

Browse files
neethajohnyxieca
authored andcommitted
Do not start pfcwd for M0 devices (#726)
* Do not start pfcwd for M0 devices Signed-off-by: Neetha John <[email protected]> * Avoid exiting for device type error Signed-off-by: Neetha John <[email protected]>
1 parent 2c0af8a commit e4a5e4c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

config/main.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,16 @@ def load_minigraph():
527527
"""Reconfigure based on minigraph."""
528528
log_info("'load_minigraph' executing...")
529529

530+
# get the device type
531+
command = "{} -m -v DEVICE_METADATA.localhost.type".format(SONIC_CFGGEN_PATH)
532+
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
533+
device_type, err = proc.communicate()
534+
if err:
535+
click.echo("Could not get the device type from minigraph, setting device type to Unknown")
536+
device_type = 'Unknown'
537+
else:
538+
device_type = device_type.strip()
539+
530540
#Stop services before config push
531541
_stop_services()
532542

@@ -540,7 +550,8 @@ def load_minigraph():
540550
command = "{} -H -m --write-to-db".format(SONIC_CFGGEN_PATH)
541551
run_command(command, display_cmd=True)
542552
client.set(config_db.INIT_INDICATOR, 1)
543-
run_command('pfcwd start_default', display_cmd=True)
553+
if device_type != 'MgmtToRRouter':
554+
run_command('pfcwd start_default', display_cmd=True)
544555
if os.path.isfile('/etc/sonic/acl.json'):
545556
run_command("acl-loader update full /etc/sonic/acl.json", display_cmd=True)
546557
run_command("config qos reload", display_cmd=True)

0 commit comments

Comments
 (0)