Code Monkey home page Code Monkey logo

Comments (11)

jeaubin avatar jeaubin commented on June 9, 2024

Thanks, we will look into it.

from genieparser.

jeaubin avatar jeaubin commented on June 9, 2024

It has been fixed, It will be part of the next release which is planned for next week.

from genieparser.

urskog84 avatar urskog84 commented on June 9, 2024

in witch release will the fix be included?
after upgrade #pip3 install genie.libs.parser --upgrade --pre
i get version - genie.libs.parser 19.7.1b5

still the same problem

/Petter

from genieparser.

jeaubin avatar jeaubin commented on June 9, 2024

This will be part of the official release which is releasing tomorrow.

Will let you know once it is.

from genieparser.

urskog84 avatar urskog84 commented on June 9, 2024

I still have the issue in the 19.8 releas.

 pip3 list | grep parser
genie.libs.parser            19.8
genie.metaparser             19.8
genie.parsergen              19.8

error output

[2019-08-28 05:30:51,299] +++ tstipswi002: executing command 'show module' +++
show module
Chassis Type : WS-C4507R+E

Power consumed by backplane : 40 Watts

Mod Ports Card Type                              Model              Serial No.
---+-----+--------------------------------------+------------------+-----------
 1    48  10/100/1000BaseT Premium POE E Series  WS-X4648-RJ45V+E   JAE1747099J
 3     6  Sup 7L-E 10GE (SFP+), 1000BaseX (SFP)  WS-X45-SUP7L-E     CAT1745L39S
 6    48  10/100/1000BaseT Premium POE E Series  WS-X4648-RJ45V+E   JAE201200M0
 7    48  10/100/1000BaseT Premium POE E Series  WS-X4648-RJ45V+E   JAE180604R8

 M MAC addresses                    Hw  Fw           Sw               Status
--+--------------------------------+---+------------+----------------+---------
 1 24e9.b312.de30 to 24e9.b312.de5f 3.1                               Ok
 3 885a.92d1.aac0 to 885a.92d1.aac5 3.0 15.0(1r)SG10 03.06.07.E       Ok
 6 00f2.8b92.bf4e to 00f2.8b92.bf7d 3.1                               Ok
 7 b838.6144.4420 to b838.6144.444f 3.1                               Ok

Mod  Redundancy role     Operating mode      Redundancy status
----+-------------------+-------------------+----------------------------------
 3   Active Supervisor   RPR                 Active

System Failures:
----------------
Power Supply:   bad/off (see 'show power')

tstipswi002#
---------------------------------------------------------------------------
SchemaEmptyParserError                    Traceback (most recent call last)
/git/pyats_version_test/inventering.py in <module>
     33 for device in device_list:
     34     log.info("parse command in '{d}'".format(d=device.name))
---> 35     inv_data = device.parse('show module')
     36     all_data[device.name] = inv_data
     37

/usr/local/lib64/python3.7/site-packages/genie/conf/base/device.cpython-37m-x86_64-linux-gnu.so in genie.conf.base.device.Device.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/_metaparser.cpython-37m-x86_64-linux-gnu.so in genie.metaparser._metaparser.MetaParser.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/_metaparser.cpython-37m-x86_64-linux-gnu.so in genie.metaparser._metaparser.MetaParser.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/util/schemaengine.cpython-37m-x86_64-linux-gnu.so in genie.metaparser.util.schemaengine.Schema.validate()

SchemaEmptyParserError: Parser Output is empty

from genieparser.

tahigash avatar tahigash commented on June 9, 2024

Hi @urskog84

The 'show module' output is vary depending on platform. So, we updated the parser for cat4k with abstraction. So, could you update your testbed yaml like below (only for the device) and verify if it works?

devices:
  R1_xe:
    os: iosxe   <<< specify 'iosxe'
    platform: cat4k   <<< specify 'cat4k'
    (snip)
    custom:
      abstraction:
        order:
        - os
        - platform   <<< add platform in order of abstraction

from genieparser.

urskog84 avatar urskog84 commented on June 9, 2024

same issue:

In [15]: sw2.os
Out[15]: 'iosxe'

In [16]: sw2.platform
Out[16]: 'cat4k'

from genieparser.

tahigash avatar tahigash commented on June 9, 2024

same issue:

In [15]: sw2.os
Out[15]: 'iosxe'

In [16]: sw2.platform
Out[16]: 'cat4k'

could you please check below if you have custom section as I suggested?

>>> sw2.custom
AttrDict({'abstraction': {'order': ['os', 'platform']}})

On my env, I tested it works with below steps

>>> output = """
(output)
... """
>>> sw2.os
'iosxe'
>>> sw2.platform
'cat4k'
>>> sw2.parse('show module', output=output)
{'chassis_type': 'WS-C4507R+E', 'power_consumed': '40 Watts', 'mod': {1: {'port': 48, 'card_type': '10/100/1000BaseT Premium POE E Series', 'model': 'WS-X4648-RJ45V+E', 'serial_number': 'JAE1747099J', 'mac_address_from': '24e9.b312.de30', 'mac_address_to': '24e9.b312.de5f', 'hw_ver': '3.1', 'status': 'Ok'}, 3: {'port': 6, 'card_type': 'Sup 7L-E 10GE (SFP+), 1000BaseX (SFP)', 'model': 'WS-X45-SUP7L-E', 'serial_number': 'CAT1745L39S', 'mac_address_from': '885a.92d1.aac0', 'mac_address_to': '885a.92d1.aac5', 'hw_ver': '3.0', 'fw_ver': '15.0(1r)SG10', 'sw_ver': '03.06.07.E', 'status': 'Ok', 'redundancy_role': 'Active Supervisor', 'operating_mode': 'RPR', 'redundancy_status': 'Active'}, 6: {'port': 48, 'card_type': '10/100/1000BaseT Premium POE E Series', 'model': 'WS-X4648-RJ45V+E', 'serial_number': 'JAE201200M0', 'mac_address_from': '00f2.8b92.bf4e', 'mac_address_to': '00f2.8b92.bf7d', 'hw_ver': '3.1', 'status': 'Ok'}, 7: {'port': 48, 'card_type': '10/100/1000BaseT Premium POE E Series', 'model': 'WS-X4648-RJ45V+E', 'serial_number': 'JAE180604R8', 'mac_address_from': 'b838.6144.4420', 'mac_address_to': 'b838.6144.444f', 'hw_ver': '3.1', 'status': 'Ok'}}, 'system_failures': {'power_supply': "bad/off (see 'show power')"}}

if you see the issue even after checking above, could you please send the testbed yaml to pyats-support-ext(at)cisco.com? We will check more based on the file.

from genieparser.

urskog84 avatar urskog84 commented on June 9, 2024

Not not so easy to send the testbed.yml to you.
I have built a custom module as converts a ansible inventory to a pyats testbed file.

https://github.com/urskog84/pyats_version_test/blob/master/testbed_from_inventory.py

for testing right now i have to add/change the attributes manual in ipyathon termianl :(

In [37]: sw2.os
Out[37]: 'iosxe'

In [38]: sw2.platform
Out[38]: 'cat4k'

In [39]: sw2.custom
Out[39]: AttrDict({'abstraction': {'order': ['os', 'platform']}})

In [40]: sw2.parse('show module', output=output)
---------------------------------------------------------------------------
SchemaEmptyParserError                    Traceback (most recent call last)
<ipython-input-40-3f8396a34358> in <module>
----> 1 sw2.parse('show module', output=output)

/usr/local/lib64/python3.7/site-packages/genie/conf/base/device.cpython-37m-x86_64-linux-gnu.so in genie.conf.base.device.Device.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/_metaparser.cpython-37m-x86_64-linux-gnu.so in genie.metaparser._metaparser.MetaParser.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/_metaparser.cpython-37m-x86_64-linux-gnu.so in genie.metaparser._metaparser.MetaParser.parse()

/usr/local/lib64/python3.7/site-packages/genie/metaparser/util/schemaengine.cpython-37m-x86_64-linux-gnu.so in genie.metaparser.util.schemaengine.Schema.validate()

SchemaEmptyParserError: Parser Output is empty

from genieparser.

urskog84 avatar urskog84 commented on June 9, 2024

hmmm 😅. after sw2.disconnect() and sw2.connect(). it works!!

great work team!!!!

from genieparser.

tahigash avatar tahigash commented on June 9, 2024

hmmm 😅. after sw2.disconnect() and sw2.connect(). it works!!

great work team!!!!

Glad to hear it worked! I will close this issue soon. Thank you for reporting the issue and using pyATS/Genie!

from genieparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.