Revision 2a599282 snf-cyclades-app/synnefo/api/servers.py
b/snf-cyclades-app/synnefo/api/servers.py | ||
---|---|---|
327 | 327 |
|
328 | 328 |
password = util.random_password() |
329 | 329 |
|
330 |
# TODO: Just copied code from backend.py to fix the images backend_id |
|
331 |
# for archipelagos. Find a better way and remove double checks |
|
332 |
img_id = image['backend_id'] |
|
333 |
provider = None |
|
334 |
disk_template = flavor.disk_template |
|
335 |
if flavor.disk_template.startswith("ext"): |
|
336 |
disk_template, provider = flavor.disk_template.split("_", 1) |
|
330 |
disk_template, provider = util.get_flavor_provider(flavor) |
|
331 |
if provider: |
|
332 |
flavor.disk_template = disk_template |
|
333 |
flavor.disk_provider = provider |
|
334 |
flavor.disk_origin = None |
|
337 | 335 |
if provider == 'vlmc': |
338 |
img_id = 'null' |
|
336 |
flavor.disk_origin = image['backend_id'] |
|
337 |
image['backend_id'] = 'null' |
|
339 | 338 |
|
340 | 339 |
# dispatch server created signal |
341 | 340 |
server_created.send(sender=vm, created_vm_params={ |
342 |
'img_id': img_id,
|
|
341 |
'img_id': image['backend_id'],
|
|
343 | 342 |
'img_passwd': password, |
344 | 343 |
'img_format': str(image['format']), |
345 | 344 |
'img_personality': str(personality), |
Also available in: Unified diff