Skip to content
Permalink
Browse files
Fix deleteinstance command
  • Loading branch information
brogand93 committed May 28, 2014
1 parent 3f1e3ff commit 7d0780caeb514c182dd6112f23148ddf16704d4c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
@@ -170,22 +170,42 @@ def aggregatedlistinstances(authorization, projectid):
zone_list = zones.get_zone_names(authorization=authorization)
virtual_machine_list = _get_virtual_machines(authorization=authorization)

instance = None
filter = helper.get_filter(request.args)

if 'name' in filter:
instance = filter['name']

items = {}

zone_instances = []

for zone in zone_list:
zones_instances = []
if virtual_machine_list['listvirtualmachinesresponse']:
if instance:
virtual_machine = _get_virtual_machine_by_name(
authorization=authorization,
instance=instance
)
if virtual_machine:
zone_instances.append(
_cloudstack_virtual_machine_to_gce(
cloudstack_response=virtual_machine,
projectid=projectid,
zone=zone
)
)

elif virtual_machine_list['listvirtualmachinesresponse']:
for instance in virtual_machine_list['listvirtualmachinesresponse']['virtualmachine']:
zones_instances.append(
zone_instances.append(
_cloudstack_virtual_machine_to_gce(
cloudstack_response=instance,
projectid=projectid,
zone=zone
)
)
items['zone/' + zone] = {}
items['zone/' + zone]['zone'] = zone
items['zone/' + zone]['instances'] = zones_instances
items['zone/' + zone]['instances'] = zone_instances

populated_response = {
'kind': 'compute#instanceAggregatedList',
@@ -40,6 +40,7 @@ def _delete_instance_response(async_result, projectid):
populated_response = {
'kind': 'compute#operation',
'insertTime': async_result['created'],
'operationType': 'delete',
'name': async_result['jobid'],
'startTime': async_result['created'],
'selfLink': urllib.unquote_plus(helper.get_root_url() + url_for(

0 comments on commit 7d0780c

Please sign in to comment.