Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while executing napalm get_environment() on IOSXR (ASR9K) Cisco network gear. #1189

Closed
1 task done
hgandhi7760 opened this issue Apr 29, 2020 · 3 comments
Closed
1 task done

Comments

@hgandhi7760
Copy link

Description of Issue/Question

Ran into the below issue while executing napalm get_environment() on IOSXR (ASR9K) Cisco network gear: -
raise XMLCLIError(error_msg, self)
pyIOSXR.exceptions.XMLCLIError:

Note: Please check https://guides.github.com/features/mastering-markdown/
to see how to properly format your request.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

WARNING: Could not generate requirement for distribution -etmiko 2.4.2 (/usr/local/lib/python3.6/site-packages): Parse error at "'-etmiko='": Expected W:(abcd...)
napalm==2.5.0
napalm-iosxr-grpc==0.0.1a1

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Cisco IOS XR Software, Version 6.2.3[Default]
Copyright (c) 2017 by Cisco Systems, Inc.

ROM: System Bootstrap, Version 3.04(20160331:102636) [ASR9K ROMMON],

<router's hostname> uptime is 39 weeks, 2 days, 13 hours, 38 minutes
System image file is "bootflash:disk0/asr9k-os-mbi-6.2.3/0x100000/mbiasr9k-rp.vm"

cisco ASR9K Series (P4040) processor with 8388608K bytes of memory.
P4040 processor at 1500MHz, Revision 3.0
ASR-9001 Chassis

2 Management Ethernet
8 TenGigE
8 DWDM controller(s)
8 WANPHY controller(s)
219k bytes of non-volatile configuration memory.
2868M bytes of hard disk.
3915760k bytes of disk0: (Sector size 512 bytes).

Configuration register on node 0/RSP0/CPU0 is 0x2102
Boot device on node 0/RSP0/CPU0 is disk0:

Steps to Reproduce the Issue

Below Code was executed:

import napalm
from pprint import pprint as pp
from getpass import getpass
import netmiko
import paramiko
from pyIOSXR.iosxr import IOSXR

driver = napalm.get_network_driver('iosxr')
password = getpass('password: ')
ssh_config_file = '/Users/.ssh/config_bkp'
spoke_device = driver(hostname=spoke_router, username='username', password='password',
optional_args={'ssh_config_file': ssh_config_file})
spoke_device.open()
device_heath = spoke_device.get_environment()
spoke_device.close()
pp(device_heath)

Error Traceback

(Paste the complete traceback of the exception between quotes below)

Traceback (most recent call last):
  File "/Users/<device name>/Library/Application Support/JetBrains/PyCharmCE2020.1/scratches/scratch_5.py", line 31, in <module>
    device_heath = spoke_device.get_environment()
  File "/usr/local/lib/python3.6/site-packages/napalm/iosxr/iosxr.py", line 658, in get_environment
    result_tree = ETREE.fromstring(self.device.make_rpc_call(rpc_command))
  File "/usr/local/lib/python3.6/site-packages/pyIOSXR/iosxr.py", line 151, in make_rpc_call
    result = self._execute_rpc(rpc_command)
  File "/usr/local/lib/python3.6/site-packages/pyIOSXR/iosxr.py", line 416, in _execute_rpc
    raise XMLCLIError(error_msg, self)
pyIOSXR.exceptions.XMLCLIError: 
Original call was: <?xml version="1.0" encoding="UTF-8"?><Request MajorVersion="1" MinorVersion="0"><Get><AdminOperational><MemorySummary>            </MemorySummary></AdminOperational></Get></Request>

PLEASE NOTE - napalm() get_enviornment works perfectly fine with Junos and IOS-XE.

@mcroff-wish
Copy link

I suspect this is the same issue as: #1181

@hgandhi7760
Copy link
Author

Hi there,
I was not sure about the network operating system version, my version is 6.2.3 and issue 1181 reported version as 6.3.3. If also suspect a parsing issue with napalm get_enviornment() module; but just to be sure i opened a new issue. If the issue is same, regardless of the network operating system version, feel free to mark this issue as resolved and i can follow issue # 1181. Thanks so much for the prompt response.

@mirceaulinic
Copy link
Member

Closing as duplicate of #1181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants