Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,16 @@ def load_minigraph():
"""Reconfigure based on minigraph."""
log_info("'load_minigraph' executing...")

# get the device type
command = "{} -m -v DEVICE_METADATA.localhost.type".format(SONIC_CFGGEN_PATH)
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
device_type, err = proc.communicate()
if err:
click.echo("Could not get the device type from minigraph, setting device type to Unknown")
device_type = 'Unknown'
else:
device_type = device_type.strip()

#Stop services before config push
_stop_services()

Expand All @@ -540,7 +550,8 @@ def load_minigraph():
command = "{} -H -m --write-to-db".format(SONIC_CFGGEN_PATH)
run_command(command, display_cmd=True)
client.set(config_db.INIT_INDICATOR, 1)
run_command('pfcwd start_default', display_cmd=True)
if device_type != 'MgmtToRRouter':
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to check if device_type contains 'Mgmt' ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per our discussion, leaving this as is

run_command('pfcwd start_default', display_cmd=True)
if os.path.isfile('/etc/sonic/acl.json'):
run_command("acl-loader update full /etc/sonic/acl.json", display_cmd=True)
run_command("config qos reload", display_cmd=True)
Expand Down