File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -303,17 +303,21 @@ def cli(
303
303
else :
304
304
prefix = f"{ topo ['prefix' ]} -{ lab_name } -"
305
305
hosts : Dict [str , Dict [str , Any ]] = {}
306
- def_kind = topo ["topology" ].get ("defaults" , {}).get ("kind" )
306
+ srlinux_def = (
307
+ True
308
+ if "srlinux:" in topo ["topology" ].get ("defaults" , {}).get ("image" , "" )
309
+ else False
310
+ )
307
311
srl_kinds = [
308
312
k
309
313
for k , v in topo ["topology" ].get ("kinds" , {}).items ()
310
314
if "srlinux:" in v .get ("image" )
311
315
]
312
316
clab_nodes : Dict [str , Dict ] = topo ["topology" ]["nodes" ]
313
317
for node , node_spec in clab_nodes .items ():
314
- if node_spec . get ( "kind" ) == None :
315
- node_spec [ "kind" ] = def_kind
316
- if node_spec [ "kind" ] in srl_kinds :
318
+ if ( not "kind" in node_spec and srlinux_def ) or node_spec . get (
319
+ "kind"
320
+ ) in srl_kinds :
317
321
hosts [f"{ prefix } { node } " ] = {
318
322
"hostname" : f"{ prefix } { node } " ,
319
323
"platform" : "srlinux" ,
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " nornir-srl"
3
- version = " 0.2.11 "
3
+ version = " 0.2.12 "
4
4
description = " Nornir connection plugin for SRLinux"
5
5
authors = [" Walter De Smedt <walter.de.smedt@gmail.com>" ]
6
6
readme = " README.md"
You can’t perform that action at this time.
0 commit comments