def make_secgroup_list(security_groups):
 secgroups = objects.SecurityGroupList()
 secgroups.objects = []
 for sg in security_groups:
  secgroup = objects.SecurityGroup()
  if uuidutils.is_uuid_like(sg):
   secgroup.uuid = sg
  else:
   secgroup.name = sg
  secgroups.objects.append(secgroup)
 return secgroups

def make_secgroup_list ( security_groups ) : secgroups = objects . SecurityGroupList ( ) secgroups . objects = [ ] for sg in security_groups : secgroup = objects . SecurityGroup ( ) if uuidutils . is_uuid_like ( sg ) : secgroup . uuid = sg else : secgroup . name = sg secgroups . objects . append ( secgroup ) return secgroups
a helper to make security group objects from a list of names or uuids .