Fix for GCU function modification for HEAD PR#2993
Fix for GCU function modification for HEAD PR#2993sabakram wants to merge 4 commits intosonic-net:masterfrom
Conversation
|
@qiluo-msft , can you please help review and merge this PR. |
|
@gechiang can you please help review this PR. Thanks! |
|
@yejianquan , I think you were helping @ridahanif96 on this submodule head PR failure. Please check if this is what would "fix" the issue? |
@gechiang thanks! |
| self.logger.log_notice("Config replacement completed.") | ||
|
|
||
| @staticmethod | ||
| def switchport_mode_remove(config): |
There was a problem hiding this comment.
Please add some comments for the background reason for removing the config['PORT'][port]['mode']
There was a problem hiding this comment.
Added as per suggestion, thanks
| if 'PORT' in config: | ||
| for port, port_data in config['PORT'].items(): | ||
| if 'mode' in port_data: | ||
| del config['PORT'][port]['mode'] |
There was a problem hiding this comment.
Please extract constants for string 'mode' and 'PORT'
There was a problem hiding this comment.
updated as suggested,thanks
@gechiang , In sonic-mgmt repo, Rida had made the compatible change, but I'm still not sure whether this PR could resolve the advancing issue totally since there's implicitly data format things... I left some comments on the code style side, still need @qiluo-msft to help review for make sure whether 'what this PR is trying to do is acceptable'. |
@yejianquan all of your suggestions are incorportated,thanks. @qiluo-msft can you please help in review this PR, so we can resolve HEAD PR issue, thanks. |
|
@qiluo-msft , can you please help review this PR? Its a time sensitive issue for HEAD PR. |
|
The root issue is PORT/mode is not yang modelled. I see open PR sonic-net/sonic-buildimage#13580. |
qiluo-msft
left a comment
There was a problem hiding this comment.
Block this PR until yang model is avaiable.
What I did
This PR is created to resolve submodule HEAD PR KVM t0 Elastic failure issues. KVM Elastic test cases are failing due to missing mode attribute in configuration. When a rollback checks an exisitng patch it showns error:
"All keys are not parsed in PORT".
"dict_keys(['Ethernet4'])"
"exceptionList: [" 'mode' "]
This PR Updated GCU function so that it can be compatible with HEAD PR and passed. This proposed change is a temporary solution to pass failing testcases and it will be reverted back once in hand issue is resolved and sub-modules are added in HEAD.
How I did it
Modified generic_updater.py. Added a logic in def replace function such that it will not fail in rollback. In this way it will pass KVM Elastic (GCU_Dhcp_relay.py test)