

def _get_instance(self, cur_sg_ids):
    instance_port = [p for p in self.api_ports.list() if p['device_owner'].startswith('compute:')][0]
    instance_id = instance_port['device_id']
    instance_ports = []
    for _i in range(2):
        p = copy.deepcopy(instance_port)
        p['id'] = str(uuid.uuid4())
        p['security_groups'] = cur_sg_ids
        instance_ports.append(p)
    return (instance_id, instance_ports)

dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/test/api_tests/network_tests.py NetworkApiNeutronSecurityGroupTests._get_instance/original