def _check_group_branches(config, physical_skel):
 logging.debug('Checking group branches match expectations')
 for (group, relations) in physical_skel.items():
  if ('belongs_to' not in relations):
   continue
  parents = relations['belongs_to']
  for parent in parents:
   if (parent in config.keys()):
    message = 'Group {parent} has a child group {child}, but also has host entries in user configuration. Hosts cannot be sibling with groups.'.format(parent=parent, child=group)
    raise GroupConflict(message)
 logging.debug('Group branches ok.')
 return True

def _check_group_branches ( config , physical_skel ) : logging . debug ( 'Checking group branches match expectations' ) for ( group , relations ) in physical_skel . items ( ) : if ( 'belongs_to' not in relations ) : continue parents = relations [ 'belongs_to' ] for parent in parents : if ( parent in config . keys ( ) ) : message = 'Group {parent} has a child group {child}, but also has host entries in user configuration. Hosts cannot be sibling with groups.' . format ( parent = parent , child = group ) raise GroupConflict ( message ) logging . debug ( 'Group branches ok.' ) return True
ensure that groups have either hosts or child groups .