Skip to content

Add a name for VRF table#173

Merged
pavel-shirshov merged 1 commit intosonic-net:masterfrom
pavel-shirshov:pavelsh/vrf_define
Jan 8, 2018
Merged

Add a name for VRF table#173
pavel-shirshov merged 1 commit intosonic-net:masterfrom
pavel-shirshov:pavelsh/vrf_define

Conversation

@pavel-shirshov
Copy link
Copy Markdown
Contributor

Add a table name for VRF table.

@pavel-shirshov pavel-shirshov merged commit aa55f69 into sonic-net:master Jan 8, 2018
@pavel-shirshov pavel-shirshov deleted the pavelsh/vrf_define branch January 8, 2018 19:26
prgeor pushed a commit to prgeor/sonic-swss-common that referenced this pull request Feb 27, 2025
…nic-net#173)

#### Description
- Use class and instance attributes properly. Only use class attributes for data which should be shared among all instances.
- Import all modules in `__init__.py`
- Remove unused imports
- Clean up whitespace

#### Motivation and Context
Proper object-oriented programming. This could prevent issues where attributes are shared between instances when they were not meant to be.

This also fixes a bug with `PsuBase.psu_master_led_color`, where it is defined as both a class attribute and an instance attribute.

With this change, some vendors' APIs can be cleaned up, because they redefined class attributes as instance attributes. That code can be removed.

However, note that vendor APIs MUST call the base class initializer in their initializer methods, or the instance attributes will not be available and will raise exceptions.
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