-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial release #12
Initial release #12
Conversation
Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
while [ ${TRIES} -gt 0 ] | ||
do | ||
RETRY=0 | ||
STATUS="$(show system status 2> /dev/null)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is show system status
a new CLI on SONiC? Does not seem to work on 201911.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed dead code. #16 fixes it.
if [ "$DEST" = "" ]; then | ||
DEST=${TMP_ZTP_CONFIG_DB_JSON} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEST should be DEST_FILE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16 fixes it.
updateActivity "Restarting network configuration" | ||
# Restart interface configuration to stop DHCP | ||
systemctl restart interfaces-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [ "$2" = "config-fallback" ]
, config reload
is triggered, including restarting interfaces-config service. There may be no need to redo interfaces-config restart for this logic branch. It may only be needed in the case of Remove ZTP configuration from config-db
on line 266
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. will fix it with any other comments you may have.
if finalResult == 'FAILED' and section.get('error') is None: | ||
section['error'] = 'Plugin failed' | ||
section['exit-code'] = rc | ||
self.objztpJson.updateStatus(section, finalResult) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateStatus
may need to be moved before line 452 so that section['timestamp']
gets an updated timestamp, which otherwise is the timestamp when the processing of Configuration section starts.
If so, we may need to call writeJson() here to save updates in field 'error' and 'exit-code' to ztp_data.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we can move the log message from line#452 to after line#456?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to after line 456 is more efficient 👍. #12 (comment)
if finalResult == 'FAILED' and section.get('error') is None: | ||
section['error'] = 'Plugin failed' | ||
section['exit-code'] = rc | ||
self.objztpJson.updateStatus(section, finalResult) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to after line 456 is more efficient 👍. #12 (comment)
community_ro = getField(section_data, 'community-ro', str, default_value=None) | ||
if section_data.get('snmp-location') is not None: | ||
no_section = False | ||
snmp_location = getField(section_data, 'snmp-location', str, default_value=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"admin_status": "up" | ||
{% else %} | ||
"admin_status": "down" | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'fec' may need to be introduced for >= 100G links as it may be a common practice to use 'rs' in such a context, otherwise these front-panel ports will not be oper_status up due to the 'fec' mismatch at the two end points of a link.
First release of SONiC Zero Touch Provisioning feature
Signed-off-by: Rajendra Dendukuri rajendra.dendukuri@broadcom.com