Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
when will MGMT_INTERFACE be not defined? how to assume that eth0 is the one to use.
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.
For the first question, if the mgmt interface is not in the minigraph, then it will not be defined. I think we do have such cases for the default minigraph. It does not have management ip configured so dhcp is enabled.
for the second qeustion, it is a good question. but we are implicit assuming eth0 in several other places like the interface.j2. I think that is one of basic assumption here. This assumption can be relaxed later, but it is probably not related to this PR.
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.
@stcheng the changes made here is the similar how interfaces are interpreter int system https://github.com/Azure/sonic-buildimage/blob/master/files/image_config/interfaces/interfaces.j2#L23
MGMT_INTERFACE will not be defined when user will not add corresponding section in minigraph or configDB.
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.
thanks for the explanations!