Skip to content

find_system_with_ip of AosManagedDevices/AosSystemAgents returns NullSystem wrongly #36

@rajakumar23

Description

@rajakumar23

AOS manages below mentioned 6 devices, but when I try to fetch a specific entry based on ip address, it returns NullSystem wrongly though the system has that entry.

`
(Pdb) n

/.venv/lib/python3.8/site-packages/aos/devices.py(184)find_system_with_ip()
-> if system.facts["mgmt_ipaddr"] == ip_addr:
(Pdb) p ip_addr
'10.28.228.12'
(Pdb) p system.facts["mgmt_ipaddr"]
'10.28.228.15'
(Pdb) n
/.venv/lib/python3.8/site-packages/aos/devices.py(186)find_system_with_ip()
-> return NullSystem
`

`

/.venv/lib/python3.8/site-packages/aos/devices.py(221)find_agent_with_ip()
-> if agent.management_ip == ip_addr:
(Pdb) p ip_addr
'10.28.228.12'
(Pdb) p agent.management_ip
'10.28.228.11'
(Pdb) n
/.venv/lib/python3.8/site-packages/aos/devices.py(223)find_agent_with_ip()
-> return NullSystemAgent
`

`<SNIP - output of get_all() >
<aos.client.AosClient object at 0x7fcd910efbb0>
("System(id='525400B11325', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_15-f', 'status': 'running'}, "
"device_key='525400B11325', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:c0:1c:00:00-00:00:c0:1c:00:3f,02:05:86:71:f8:00-02:05:86:71:f8:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.15', 'mgmt_macaddr': '52:54:00:B1:13:25', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '525400B11325', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:56.739507Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:17:31.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")

("System(id='525400F7EEAF', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_16-f', 'status': 'running'}, "
"device_key='525400F7EEAF', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:e7:62:00:00-00:00:e7:62:00:3f,02:05:86:71:1c:00-02:05:86:71:1c:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.16', 'mgmt_macaddr': '52:54:00:F7:EE:AF', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '525400F7EEAF', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:55.935273Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:17:49.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")

("System(id='5254005D481D', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_13-f', 'status': 'running'}, "
"device_key='5254005D481D', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:03:94:00:00-00:00:03:94:00:3f,02:05:86:71:32:00-02:05:86:71:32:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.13', 'mgmt_macaddr': '52:54:00:5D:48:1D', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '5254005D481D', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:55.665624Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:16:49.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")

("System(id='525400AC4267', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_14-f', 'status': 'running'}, "
"device_key='525400AC4267', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:4b:6a:00:00-00:00:4b:6a:00:3f,02:05:86:71:ec:00-02:05:86:71:ec:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.14', 'mgmt_macaddr': '52:54:00:AC:42:67', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '525400AC4267', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:53.299949Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:17:15.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")

("System(id='5254008D8E61', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_11-f', 'status': 'running'}, "
"device_key='5254008D8E61', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:33:3c:00:00-00:00:33:3c:00:3f,02:05:86:71:e5:00-02:05:86:71:e5:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.11', 'mgmt_macaddr': '52:54:00:8D:8E:61', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '5254008D8E61', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:50.792788Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:16:02.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")

("System(id='525400C5805C', container_status={'error': '', 'host': "
"'AosController', 'name': 'aos-offbox-10_28_228_12-f', 'status': 'running'}, "
"device_key='525400C5805C', facts={'aos_hcl_model': 'Juniper_vQFX', "
"'aos_server': '10.28.228.3', 'aos_version': 'AOS_4.1.1_OB.287', "
"'chassis_mac_ranges': "
"'00:00:46:e7:00:00-00:00:46:e7:00:3f,02:05:86:71:09:00-02:05:86:71:09:00', "
"'hw_model': 'VQFX-10000', 'hw_version': '', 'mgmt_ifname': 'em0', "
"'mgmt_ipaddr': '10.28.228.12', 'mgmt_macaddr': '52:54:00:C5:80:5C', "
"'os_arch': 'x86_64', 'os_family': 'Junos', 'os_version': '20.2R1.10', "
"'os_version_info': {'build': '10', 'major': '20', 'minor': '2R1'}, "
"'serial_number': '525400C5805C', 'vendor': 'Juniper'}, services=[], "
"status={'agent_start_time': '2022-08-29T17:25:54.636863Z', 'comm_state': "
"'on', 'device_start_time': '2022-08-29T14:16:31.000000Z', 'error_message': "
"'', 'is_acknowledged': True, 'operation_mode': 'full_control', 'pool_id': "
"'default_pool', 'state': 'OOS-READY'}, user_config={'admin_state': 'normal', "
"'aos_hcl_model': 'Juniper_vQFX', 'location': ''})")
<SNIP - output of get_all() >`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions