-
Notifications
You must be signed in to change notification settings - Fork 175
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
recursive application of field pattern for list type values #11
Comments
|
Whilst not exactly elegant, the following use of 'Continue' will capture the port names:
Variants on this can be used to capture the first line in each port channel group. |
I used something similar to capture interfaces in a VRF:
{u'MGMT': {u'interfaces': {u'interface': {u'Vlan2': {},
u'Vlan3': {},
u'Vlan4': {}}},
u'name': u'MGMT',
u'state': {u'route_distinguisher': u'0:0'},
u'type': u'L3VRF'},
u'NON': {u'interfaces': {u'interface': {}},
u'name': u'NON',
u'state': {u'route_distinguisher': u''},
u'type': u'L3VRF'},
u'TEST': {u'interfaces': {u'interface': {u'Vlan100': {},
u'Vlan101': {},
u'Vlan102': {},
u'Vlan103': {},
u'Vlan104': {}}},
u'name': u'TEST',
u'state': {u'route_distinguisher': u'0:1'},
u'type': u'L3VRF'},
u'TEST2': {u'interfaces': {u'interface': {}},
u'name': u'TEST2',
u'state': {u'route_distinguisher': u'1234:4321'},
u'type': u'L3VRF'},
u'default': {u'interfaces': {u'interface': {u'Ethernet1': {},
u'Management1': {}}},
u'name': u'default',
u'state': {u'route_distinguisher': u''},
u'type': u'DEFAULT_INSTANCE'}} note: I stripped the commas off in Python |
This final example makes a good point. By over matching on the 'Interfaces' Value, the whole row is captured by each entry. It is then possible to post-process the entries to split the rows into individual elements. |
There are cases where a field of List type should capture space/comma separated words in a single line. Currently in these cases last value replaces the previous values and only one item ends up in the list. Is it fairly easy to implement that feature or major refactoring required? Creating the issue for collecting input before start working on it. Thanks. Attaching the following example, Member Ports should be a Value field in List type.
The text was updated successfully, but these errors were encountered: