Skip to content

[AnsibleHostBase] raise AttributeError in __getattr__#2354

Merged
lolyu merged 1 commit intosonic-net:masterfrom
lolyu:fix_getattr
Oct 16, 2020
Merged

[AnsibleHostBase] raise AttributeError in __getattr__#2354
lolyu merged 1 commit intosonic-net:masterfrom
lolyu:fix_getattr

Conversation

@lolyu
Copy link
Copy Markdown
Collaborator

@lolyu lolyu commented Oct 16, 2020

Description of PR

As __getattr__ is the last place searching for an attribute, no need
to resort to object because:

  1. there is no __getattr__ in object.
  2. the Python attribute lookup has already searched object before
    calling __getattr__.

So, raise AttributeError in the end.

Signed-off-by: Longxiang Lyu [email protected]

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

As `__getattr__` is the last place searching for an attribute, no need
to resort to `object` because:
1. there is no `__getattr__` in `object`.
2. the Python attribute lookup has already searched `object` before
calling `__getattr__`.

So, raise `AttributeError` in the end.

Signed-off-by: Longxiang Lyu <[email protected]>
@lolyu lolyu requested a review from a team October 16, 2020 03:35
@lolyu
Copy link
Copy Markdown
Collaborator Author

lolyu commented Oct 16, 2020

@wangxin, could you please help to review, thanks!

Copy link
Copy Markdown
Collaborator

@bingwang-ms bingwang-ms left a comment

Choose a reason for hiding this comment

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

LGTM

@lolyu lolyu merged commit bdfd25b into sonic-net:master Oct 16, 2020
@lolyu lolyu deleted the fix_getattr branch October 16, 2020 07:20
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
swss:
* 665bbbb 2022-06-27 | Add support for IP interface loopback action (sonic-net#2307) (HEAD -> 202205, github/202205) [Lior Avramov]
* c7f5743 2022-06-28 | [asan] suppress the static variable leaks (sonic-net#2354) [Yakiv Huryk]
* 37e2a31 2022-06-28 | [tests] [asan] add graceful stop flag (sonic-net#2347) [Yakiv Huryk]
* 5ab84cf 2022-06-28 | [202205][cherry-pick] Fix mux_acl_rule adding issue (sonic-net#2358) [bingwang-ms]

linkmgrd:
* a836ef7 2022-06-28 | Use Vlan MAC as src MAC for link prober by default  (sonic-net#93) (HEAD -> 202205) [Jing Zhang]
* a828e86 2022-06-28 | Fix inconsistent mux state (sonic-net#92) (github/202205) [Longxiang Lyu]

Signed-off-by: Ying Xie <[email protected]>
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