Skip to content

Community objects have 'sequence' in 'value' attribute #2155

Closed
@jbemmel

Description

@jbemmel

sqlist = [ pe.sequence for pe in np_data ] # Get the list of sequence numbers from the local policy

There may be an issue here: sequence is found at different levels in the hierarchy

routing:
  _rm_per_af: true
  community:
    c1:
      regexp: ''
      type: standard
      value:
      - _value: 65233:101
        action: permit
        sequence: 10
  policy:
    set_pref:
    - action: permit
      match:
        community: c1
      sequence: 10
      set:
        locpref: 120

i.e. for o_name==community it's at community.(id).value while for o_name==policy it's at policy.(id)

I hit an error with this lab:

---

provider: clab

defaults.device: frr

plugin: [ bgp.policy ]

bgp.as: 65000

routing:
  community:
    c1: '65000:123'

nodes:
  dfy:
    module: [ bgp, routing ]
    routing:
     # community:
     #  c1: '65000:123'
     policy:
      set_pref:
      - match.community: c1
        set.locpref: 120
 File "/home/user/netlab/netsim/modules/routing.py", line 244, in import_routing_object
    sqlist  = [ pe.sequence for pe in np_data ]               # Get the list of sequence numbers from the local policy
                ^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'sequence'

Defining the community at the node level removes the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions