Commit 71162da5 by Karsa Zoltán István

fix bugs

parent 8b5c4576
......@@ -496,6 +496,7 @@ class Disk(TimeStampedModel):
disk.type = result['type']
disk.checksum = result['checksum']
disk.is_ready = True
disk.ci_disk = False
disk.save()
return disk
......
......@@ -372,7 +372,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
@property
def get_meta_data(self):
data = str(self.ci_user_data).replace('{{hostname}}', self.short_hostname)
data = str(self.ci_meta_data).replace('{{hostname}}', self.short_hostname)
return data
def _update_status(self):
......
......@@ -435,7 +435,7 @@ class DeployOperation(InstanceOperation):
self.instance.save()
else:
self.instance.allocate_node()
logger.debug(' - - valami - - ')
init_disk = None
try:
init_disk = self.instance.disks.get(ci_disk=True)
......@@ -505,6 +505,10 @@ class DeployOperation(InstanceOperation):
disk.full_clean()
disk.save()
self.instance.disks.add(disk)
return create_readable(ugettext_noop(
" ---- META-DATA ----\n%(meta_data)s\n\n ---- USER-DATA ----\n%(user_data)s"),
meta_data=self.instance.get_meta_data,
user_data=self.instance.get_user_data)
@register_operation
class DeployDisksOperation(SubOperationMixin, InstanceOperation):
......@@ -843,7 +847,7 @@ class SaveAsTemplateOperation(InstanceOperation):
'ci_meta_data': self.instance.ci_meta_data,
'ci_user_data': self.instance.ci_user_data,
}
print(params)
params.update(kwargs)
params.pop("parent_activity", None)
......@@ -857,6 +861,7 @@ class SaveAsTemplateOperation(InstanceOperation):
self.disks = []
for disk in self.instance.disks.all():
if disk.ci_disk == False:
with activity.sub_activity(
'saving_disk',
readable_name=create_readable(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment