Skip to content

Fix the platform_info test failure because of callback loader#1667

Merged
sujinmkang merged 1 commit intosonic-net:201811from
sujinmkang:platform_info
May 14, 2020
Merged

Fix the platform_info test failure because of callback loader#1667
sujinmkang merged 1 commit intosonic-net:201811from
sujinmkang:platform_info

Conversation

@sujinmkang
Copy link
Contributor

Description of PR

platform_info test on 201811 branch failed with following error

test_show_platform_summary
ImportError while loading conftest '/var/sonicbld/workspace/NewTests/platform_info/tests/conftest.py'.
conftest.py:9: in <module>
    from ansible_host import AnsibleHost
ansible_host.py:1: in <module>
    from ansible.plugins import callback_loader
E   ImportError: cannot import name callback_loader

Summary:
Fixes # (issue)
change to pick up the proper path for the callback_loader plugin path based on ansible version

Type of change

  • [x ] Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

Import the callback_loader from the right path

How did you verify/test it?

Run test_platform_info.py

Any platform specific information?

N/A

Supported testbed topology if it's a new test case?

N/A

Documentation

@qiluo-msft
Copy link
Contributor

Do you want to PR against master, and cherry-pick to 201811?

@lguohan
Copy link
Contributor

lguohan commented May 13, 2020

agree with @qiluo-msft

@sujinmkang
Copy link
Contributor Author

@qiluo-msft and @lguohan Since master branch supports the latest version of ansible from beginning and it only import the callback_loader from the new ansible path, I thought it will be ok to keep the change in master as is but for 201811, the ansible version changed later so I added this change to support both old and new ansible plugin version.
To make the code consistent for master and 201811, I can create a new PR against master and cherry-pick to 201811.

@sujinmkang
Copy link
Contributor Author

@qiluo-msft and @lguohan ansible_host.py is removed on master with (#1658) so it's not possible to pr to master.

@sujinmkang sujinmkang merged commit 5e4994f into sonic-net:201811 May 14, 2020
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