mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-18 06:11:07 -07:00
issue:43021 add support for onyx version 3.6.6000 and above (#44527)
* issue:43021 add support for onyx version 3.6.6000 Signed-off-by: Samer Deeb <samerd@mellanox.com> * issue:43021 add support for onyx version 3.6.6000 Signed-off-by: Samer Deeb <samerd@mellanox.com>
This commit is contained in:
parent
56b9823bb8
commit
a07af2a1f7
6 changed files with 65 additions and 28 deletions
|
@ -335,14 +335,22 @@ class OnyxInterfaceModule(BaseOnyxModule):
|
|||
return get_interfaces_config(self._module, self._interface_type)
|
||||
|
||||
def load_current_config(self):
|
||||
self._os_version = self._get_os_version()
|
||||
self._current_config = dict()
|
||||
config = self._get_interfaces_config()
|
||||
if not config:
|
||||
return
|
||||
|
||||
for item in config:
|
||||
name = self.get_if_name(item)
|
||||
self._current_config[name] = self._create_if_data(name, item)
|
||||
if self._os_version < self.ONYX_API_VERSION:
|
||||
for if_data in config:
|
||||
if_name = self.get_if_name(if_data)
|
||||
self._current_config[if_name] = self._create_if_data(
|
||||
if_name, if_data)
|
||||
else:
|
||||
for if_config in config:
|
||||
for if_name, if_data in iteritems(if_config):
|
||||
if_data = if_data[0]
|
||||
self._current_config[if_name] = self._create_if_data(
|
||||
if_name, if_data)
|
||||
|
||||
def _generate_no_if_commands(self, req_if, curr_if):
|
||||
if self._interface_type == self.IF_TYPE_ETH:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue