Skip to content
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

Merged
merged 2 commits into from
Nov 7, 2019
Merged

Conversation

rajendra-dendukuri
Copy link
Collaborator

First release of SONiC Zero Touch Provisioning feature

Signed-off-by: Rajendra Dendukuri rajendra.dendukuri@broadcom.com

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
- DHCPv6 client is removing DHCPv4 learnt ztp information during PREINIT6 phase.
- ztp status is not displaying runtime information when ztp result is FAILED
@lguohan lguohan merged commit 374c9e8 into sonic-net:master Nov 7, 2019
while [ ${TRIES} -gt 0 ]
do
RETRY=0
STATUS="$(show system status 2> /dev/null)"
Copy link

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.

Copy link
Collaborator Author

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.

Comment on lines +116 to +117
if [ "$DEST" = "" ]; then
DEST=${TMP_ZTP_CONFIG_DB_JSON}
Copy link

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#16 fixes it.

Comment on lines +270 to +272
updateActivity "Restarting network configuration"
# Restart interface configuration to stop DHCP
systemctl restart interfaces-config
Copy link

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

Copy link
Collaborator Author

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)
Copy link

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.

Copy link
Collaborator Author

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?

Copy link

@wendani wendani Jun 10, 2020

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)
Copy link

@wendani wendani Jun 10, 2020

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)
Copy link

Choose a reason for hiding this comment

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

community_ro and snmp_location need to be declared None before try logic following restart_agent, otherwise if only one of them is provided in ztp playbook, which is a valid case, an exception will be thrown at either line 113 or line 116, complaining variable undefined.

"admin_status": "up"
{% else %}
"admin_status": "down"
{% endif %}
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants