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

show policy map interface <interface> parser IOSXR #731

Open
wilbeacham85 opened this issue Feb 23, 2023 · 5 comments
Open

show policy map interface <interface> parser IOSXR #731

wilbeacham85 opened this issue Feb 23, 2023 · 5 comments
Assignees

Comments

@wilbeacham85
Copy link

I get the following error when using the show policy-map interface paser for IOSXR

Issue with the parser show policy-map interface TenGigE0/0/0/1

root@56e5a383c801:/home/cisco/cxta# genie parse "show policy-map interface TenGigE0/0/0/1" --testbed-file Global_Files/Testbed/Topology.yaml --device PE-1ASR9010

Traceback (most recent call last):
  File "src/genie/cli/commands/parser.py", line 339, in genie.cli.commands.parser.ParserCommand.parse
  File "src/genie/conf/base/device.py", line 531, in genie.conf.base.device.Device.parse
  File "src/genie/conf/base/device.py", line 570, in genie.conf.base.device.Device._get_parser_output
  File "src/genie/conf/base/device.py", line 568, in genie.conf.base.device.Device._get_parser_output
  File "src/genie/metaparser/_metaparser.py", line 308, in genie.metaparser._metaparser.MetaParser.parse
  File "/venv/lib/python3.9/site-packages/genie/libs/parser/iosxr/show_policy_map.py", line 240, in cli
    match_dict = class_stat_dict.setdefault('matched', {})
UnboundLocalError: local variable 'class_stat_dict' referenced before assignment
@Taarini
Copy link
Contributor

Taarini commented Feb 23, 2023

Hi

Thanks for reporting the issue. Can you please share the device output for the parser command you got this error.

@Taarini Taarini self-assigned this Feb 23, 2023
@Taarini
Copy link
Contributor

Taarini commented Feb 24, 2023

Hi

Can you please share the above details to debug the issue

@Taarini
Copy link
Contributor

Taarini commented Feb 27, 2023

Hi

Can you please share the requested details

@wilbeacham85
Copy link
Author

wilbeacham85 commented Mar 2, 2023

show policy-map interface TenGigE0/0/0/1
Thu Mar  2 14:29:15.794 UTC
TenGigE0/0/0/1 direction input: Service Policy not installed

TenGigE0/0/0/1 output: 20_CORE-EGRESS_PM

Class REALTIME-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Policing statistics                (packets/bytes)     (rate - kbps) 
    Policed(conform)    :                   0/0                    0
    Policed(exceed)     :                   0/0                    0
    Policed(violate)    :                   0/0                    0
    Policed and dropped :                   0/0                  
  Queueing statistics
    Queue ID                             : 65600 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0
          
Class MARKET-DATA-UDP-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65602 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

Class MARKET-DATA-TCP-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65603 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

    WRED profile for WRED Curve 1
    RED Transmitted (packets/bytes)            : N/A
    RED random drops(packets/bytes)            : 0/0
    RED maxthreshold drops(packets/bytes)      : N/A 
    RED ecn marked & transmitted(packets/bytes): N/A 
    WRED profile for WRED Curve 2
    RED Transmitted (packets/bytes)            : N/A
    RED random drops(packets/bytes)            : 0/0
    RED maxthreshold drops(packets/bytes)      : N/A 
    RED ecn marked & transmitted(packets/bytes): N/A 
Class SCAVENGER-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65604 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

Class CONTROL-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65605 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

Class BUSINESS-DEFAULT-EGRESS_CM
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65606 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

    WRED profile for WRED Curve 1
    RED Transmitted (packets/bytes)            : N/A
    RED random drops(packets/bytes)            : 0/0
    RED maxthreshold drops(packets/bytes)      : N/A 
    RED ecn marked & transmitted(packets/bytes): N/A 
    WRED profile for WRED Curve 2
    RED Transmitted (packets/bytes)            : N/A
    RED random drops(packets/bytes)            : 0/0
    RED maxthreshold drops(packets/bytes)      : N/A 
    RED ecn marked & transmitted(packets/bytes): N/A 
Class class-default
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 65607 
    High watermark                       : N/A 
    Inst-queue-len  (packets)            : 0
    Avg-queue-len                        : N/A 
    Taildropped(packets/bytes)           : 0/0
    Queue(conform)      :                   0/0                    0
    Queue(exceed)       :                   0/0                    0
    RED random drops(packets/bytes)      : 0/0

@Taarini
Copy link
Contributor

Taarini commented Mar 3, 2023

Hi

I'm able to parse the above output for os iosxr without any issue.

{'interface': {'TenGigE0/0/0/1': {'service_policy': {'input': {'policy_status': 'Service Policy not installed'},
    'output': {'policy_name': {'20_CORE-EGRESS_PM': {'class': {'REALTIME-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65600,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'MARKET-DATA-UDP-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65602,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'MARKET-DATA-TCP-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65603,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'SCAVENGER-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65604,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'CONTROL-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65605,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'BUSINESS-DEFAULT-EGRESS_CM': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65606,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}},
        'class-default': {'classification_statistics': {'matched': {'packets/bytes': '0/0',
           'rate/kbps': 0},
          'transmitted': {'packets/bytes': '0/0', 'rate/kbps': 0},
          'total_dropped': {'packets/bytes': '0/0', 'rate/kbps': 0}},
         'queueing_statistics': {'queue_id': 65607,
          'high_watermark': 'N/A',
          'inst_queue_len': '0',
          'avg_queue_len': 'N/A',
          'taildropped': '0/0',
          'queue_conform_packets': 0,
          'queue_conform_bytes': 0,
          'queue_conform_rate': 0,
          'red_random_drops_packets': 0,
          'red_random_drops_bytes': 0}}}}}}}}}}

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

No branches or pull requests

2 participants