You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to remove the '-' or list from the parent dict structure of the yaml output?
ex:
r_cfg: <<<<<<<<<--------- Is there an option to not have the '-'?
protocols:
bgp:
groups:
IBGP:
R_ASN: '65201'
local_address: Loopback0
nbrs:
- nbr: 10.100.0.1
- nbr: 10.100.0.2
- nbr: 10.100.0.3
L_ASN: '65201'
I would like for it to be as so:
r_cfg:
interfaces:
intf: Loopback0
ip: !!python/object/apply:ipaddress.IPv4Interface
- 10.1.1.1/32
is_loop: true
mask: 255.255.255.255
protocols:
bgp:
groups:
IBGP:
R_ASN: '65201'
local_address: Loopback0
nbrs:
- nbr: 10.100.0.1
- nbr: 10.100.0.2
- nbr: 10.100.0.3
L_ASN: '65201'
The text was updated successfully, but these errors were encountered:
Need to use <template name="r_cfg" results="per_template"> ...template goes here... </template> plus when calling ttp parser object result need to add structure keyword e.g. parser.result(structure="dictionary"), that combined should give you all dictionary output with no top list.
Is there a way to remove the '-' or list from the parent dict structure of the yaml output?
ex:
protocols:
bgp:
groups:
IBGP:
R_ASN: '65201'
local_address: Loopback0
nbrs:
- nbr: 10.100.0.1
- nbr: 10.100.0.2
- nbr: 10.100.0.3
L_ASN: '65201'
I would like for it to be as so:
r_cfg:
interfaces:
intf: Loopback0
ip: !!python/object/apply:ipaddress.IPv4Interface
- 10.1.1.1/32
is_loop: true
mask: 255.255.255.255
protocols:
bgp:
groups:
IBGP:
R_ASN: '65201'
local_address: Loopback0
nbrs:
- nbr: 10.100.0.1
- nbr: 10.100.0.2
- nbr: 10.100.0.3
L_ASN: '65201'
The text was updated successfully, but these errors were encountered: