def find_platform_and_atomic_group(host):
 platforms = [label.name for label in host.label_list if label.platform]
 if (not platforms):
  platform = None
 else:
  platform = platforms[0]
 if (len(platforms) > 1):
  raise ValueError(('Host %s has more than one platform: %s' % (host.hostname, ', '.join(platforms))))
 for label in host.label_list:
  if label.atomic_group:
   atomic_group_name = label.atomic_group.name
   break
 else:
  atomic_group_name = None
 return (platform, atomic_group_name)

def find_platform_and_atomic_group ( host ) : platforms = [ label . name for label in host . label_list if label . platform ] if ( not platforms ) : platform = None else : platform = platforms [ 0 ] if ( len ( platforms ) > 1 ) : raise ValueError ( ( 'Host %s has more than one platform: %s' % ( host . hostname , ', ' . join ( platforms ) ) ) ) for label in host . label_list : if label . atomic_group : atomic_group_name = label . atomic_group . name break else : atomic_group_name = None return ( platform , atomic_group_name )
figure out the platform name and atomic group name for the given host object .