instanceId.append(instance.instance_id)
# Get the information about those instances using their ids.
- reservations = conn.get_all_instances(instanceId)
+ if len(instanceId) > 0:
+ reservations = conn.get_all_instances(instanceId)
+ else:
+ reservations = []
for reservation in reservations:
for instance in reservation.instances:
instances.append(instance)
rspec = EucaRSpecBuilder(cloud).toXML()
+ # Remove the instances records so next time they won't
+ # show up.
+ if 'instances' in cloud:
+ del cloud['instances']
+
return rspec
"""