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

[sonic-config-engine] Replace os.system, replace yaml.load, remove subprocess with shell=True #12607

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

maipbui
Copy link
Contributor

@maipbui maipbui commented Nov 4, 2022

Signed-off-by: maipbui maibui@microsoft.com

Why I did it

Missing import statement in PR #12533

How I did it

Revert PR 12646
Add import statement

  1. from sonic_py_common.general import getstatusoutput_noshell
  2. from sonic_py_common.general import getstatusoutput_noshell, getstatusoutput_noshell_pipe
  3. from sonic_py_common.general import getstatusoutput_noshell

How to verify it

Pass UT

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: maipbui <maibui@microsoft.com>
@maipbui maipbui requested a review from qiluo-msft November 4, 2022 17:36
….load, remove subprocess with shell=True (sonic-net#12533)" (sonic-net#12616)"

This reverts commit 661c467.
Signed-off-by: maipbui <maibui@microsoft.com>
@maipbui maipbui changed the title [sonic-config-engine] Add missing import statement [sonic-config-engine] Replace os.system, replace yaml.load, remove subprocess with shell=True Nov 7, 2022
Signed-off-by: maipbui <maibui@microsoft.com>
@@ -351,7 +351,7 @@ def main():
if yaml.__version__ >= "5.1":
additional_data = yaml.full_load(stream)
else:
additional_data = yaml.load(stream)
additional_data = yaml.safe_load(stream)
Copy link
Collaborator

Choose a reason for hiding this comment

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

additional_data

You mentioned "Add import statement", could you point where is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it is. Updated in description.

  1. from sonic_py_common.general import getstatusoutput_noshell
  2. from sonic_py_common.general import getstatusoutput_noshell, getstatusoutput_noshell_pipe
  3. from sonic_py_common.general import getstatusoutput_noshell

@qiluo-msft
Copy link
Collaborator

This PR looks good to me. Could you dig deeper why the reverted PR was not caught by testcases on Github repo? Do we have test gap?

@maipbui maipbui merged commit 6f0b059 into sonic-net:master Nov 17, 2022
@maipbui maipbui deleted the bui/sce-add-import branch November 17, 2022 13:03
yaqiangz pushed a commit to yaqiangz/sonic-buildimage that referenced this pull request Feb 14, 2023
Resolved merge conflicts in the following files manually

device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32-Flex/buffers_defaults_t0.j2
device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32-Flex/buffers_defaults_t1.j2
device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2
device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2
device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t0.j2
device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2
device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2
device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2
src/sonic-config-engine/tests/test_j2files.py

Related work items: sonic-net#11864, sonic-net#12585, sonic-net#12607, sonic-net#12619, sonic-net#12626, sonic-net#12707, sonic-net#12714, sonic-net#12729, sonic-net#12733, sonic-net#12736, sonic-net#12750, sonic-net#12751, sonic-net#12755, sonic-net#12757, sonic-net#12758, sonic-net#12760, sonic-net#12761, sonic-net#12769, sonic-net#12783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants