'Returns a list of security group UUIDs.
Args:
security_groups: List of security group names or UUIDs'

def get_secgroup_uuids(self, security_groups):

    seclist = []
    all_groups = None
    for sg in security_groups:
        if uuidutils.is_uuid_like(sg):
            seclist.append(sg)
        else:
            if (not all_groups):
                response = self.client().list_security_groups()
                all_groups = response['security_groups']
            same_name_groups = [g for g in all_groups if (g['name'] == sg)]
            groups = [g['id'] for g in same_name_groups]
            if (len(groups) == 0):
                raise exception.EntityNotFound(entity='Resource', name=sg)
            elif (len(groups) == 1):
                seclist.append(groups[0])
            else:
                own_groups = [g['id'] for g in same_name_groups if (g['tenant_id'] == self.context.tenant_id)]
                if (len(own_groups) == 1):
                    seclist.append(own_groups[0])
                else:
                    raise exception.PhysicalResourceNameAmbiguity(name=sg)
    return seclist
