@@ -490,21 +490,22 @@ def discover_manifests(search_path, ignore_folders=None, relative_path=None,
490490def _process_testbed_file (profile , yaml_contents ):
491491 # Extract specific device information from each device
492492 # in the testbed and attach to the profile
493- testbed_info = profile .setdefault ('testbed_info' , {})
494- for dev_name , dev in yaml_contents ['devices' ].items ():
495- if isinstance (dev , dict ):
496- testbed_info [dev_name ] = {}
497- for key in ('os' , 'platform' , 'model' , 'pid' , 'type' , 'logical' ):
498- if key in dev :
499- testbed_info [dev_name ][key ] = dev [key ]
493+ if yaml_contents .get ('devices' ):
494+ testbed_info = profile .setdefault ('testbed_info' , {})
495+ for dev_name , dev in yaml_contents ['devices' ].items ():
496+ if isinstance (dev , dict ):
497+ testbed_info [dev_name ] = {}
498+ for key in ('os' , 'platform' , 'model' , 'pid' , 'type' , 'logical' ):
499+ if key in dev :
500+ testbed_info [dev_name ][key ] = dev [key ]
500501
501502def _process_clean_file (profile , yaml_contents ):
502503 # Extract bringup information from the clean file and
503504 # attach to the profile
504- clean_info = profile .setdefault ('clean_info' , {})
505505 bringup_module = yaml_contents .get ('bringup' , {}).get ('BringUpWorker' , {}).get ('module' )
506- clean_info ['bringup_module' ] = bringup_module
507-
506+ if bringup_module :
507+ clean_info = profile .setdefault ('clean_info' , {})
508+ clean_info ['bringup_module' ] = bringup_module
508509
509510yaml_processors = {
510511 'testbed-file' : _process_testbed_file ,
0 commit comments