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

[build] fix build exception and revert #9136 #10037

Merged
merged 2 commits into from
Feb 21, 2022

Conversation

ghooo
Copy link
Contributor

@ghooo ghooo commented Feb 19, 2022

Why I did it

  1. Fix Build exception example
2022-02-19T01:54:23.4200556Z ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)

This is because Jinja2 uses MarkupSafe without specifying an upper limit to the version, MarkupSafe version that was released today removed 'soft_unicode'. So now Jinja2 is complaining.

Related issues:
pallets/jinja#1591
aws/aws-sam-cli#3661

  1. Reverts [nvgre] Added YANG model and tests #9136

Fixing build failures in SONiC utils example

One of the errors:

 TestPathAddressing.test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths 

self = <tests.generic_config_updater.gu_common_test.TestPathAddressing testMethod=test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths>

    def test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths(self):
        # Arrange
        path = "/PORT/Ethernet0"
        expected = [
            "/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
            "/VLAN_MEMBER/Vlan1000|Ethernet0",
        ]
    
        # Act
        actual = self.path_addressing.find_ref_paths(path, Files.CROPPED_CONFIG_DB_AS_JSON)
    
        # Assert
>       self.assertEqual(expected, actual)
E       AssertionError: Lists differ: ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0'] != ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0']
E       
E       First list contains 1 additional elements.
E       First extra element 1:
E       '/VLAN_MEMBER/Vlan1000|Ethernet0'
E       
E       - ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0']
E       + ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0']

The VLAN_MEMBER backlink (can be called referrer link or ref link) is not found.

Issue introduced by #9136
I don't know how this PR passed the build system, it should have failed.

Known YANG issue #9312

How I did it

The import to sonic-vlan is breaking the build

    import sonic-vlan {
        prefix vlan;
    }

I am not sure if that's the only issue, so I think reverting the whole PR should be the safer option.

How to verify it

Ran sonic-utils tests locally.

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

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

Description for the changelog

Link to config_db schema for YANG module changes

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

qiluo-msft
qiluo-msft previously approved these changes Feb 19, 2022
@ghooo ghooo requested a review from lguohan as a code owner February 19, 2022 05:07
@ghooo ghooo changed the title Revert "[nvgre] Added YANG model and tests (#9136)" [build] fix build exception and revert Revert #9136 Feb 20, 2022
@ghooo ghooo changed the title [build] fix build exception and revert Revert #9136 [build] fix build exception and revert #9136 Feb 20, 2022
@ghooo ghooo mentioned this pull request Feb 20, 2022
@vadymhlushko-mlnx
Copy link
Contributor

vadymhlushko-mlnx commented Feb 21, 2022

@ghooo, @qiluo-msft
I think, the pull/9136 could be reverted but is more like a temporary crutch. Because using the import in YANG it is a generic functionality.

So, the main issue should be fixed issues/9312.

@qiluo-msft qiluo-msft merged commit f21a45b into sonic-net:master Feb 21, 2022
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.

3 participants