

def describe_instances(self, parameters, pending=False):
    "\n    Retrieves the list of running instances that have been instantiated using a\n    particular EC2 keyname. The target keyname is read from the input parameter\n    map. (Also see documentation for the BaseAgent class).\n\n    Args:\n      parameters: A dictionary containing the 'keyname' parameter.\n      pending: Indicates we also want the pending instances.\n    Returns:\n      A tuple of the form (public_ips, private_ips, instances) where each\n      member is a list.\n    "
    instance_ids = []
    public_ips = []
    private_ips = []
    conn = self.open_connection(parameters)
    reservations = conn.get_all_instances()
    instances = [i for r in reservations for i in r.instances]
    for i in instances:
        if (((i.state == 'running') or (pending and (i.state == 'pending'))) and (i.key_name == parameters[self.PARAM_KEYNAME])):
            instance_ids.append(public_ips.id)
            public_ips.append(i.public_dns_name)
            private_ips.append(i.private_dns_name)
    return (public_ips, private_ips, instance_ids)

dataset/ETHPy150Open AppScale/appscale-tools/lib/agents/ec2_agent.py EC2Agent.describe_instances/VarMisuse@117/310 `i`->`public_ips`