Fix typo 'templete'

This commit is contained in:
Marek Marczykowski 2011-03-05 15:13:31 +01:00
parent bef584c248
commit 13c3a04755
10 changed files with 26 additions and 26 deletions

View File

@ -14,7 +14,7 @@ def main():
if tvm is None: if tvm is None:
print 'Template', templ, 'does not exist' print 'Template', templ, 'does not exist'
sys.exit(1) sys.exit(1)
if not tvm.is_templete(): if not tvm.is_template():
print templ, 'is not a template' print templ, 'is not a template'
sys.exit(1) sys.exit(1)
for vm in qvm_collection.values(): for vm in qvm_collection.values():

View File

@ -261,7 +261,7 @@ class QubesVm(object):
# We can always downgrade a VM to non-updateable... # We can always downgrade a VM to non-updateable...
self.updateable = False self.updateable = False
def is_templete(self): def is_template(self):
return isinstance(self, QubesTemplateVm) return isinstance(self, QubesTemplateVm)
def is_appvm(self): def is_appvm(self):
@ -1150,7 +1150,7 @@ class QubesDisposableVm(QubesVm):
qid = kwargs["qid"] qid = kwargs["qid"]
assert template_vm is not None, "Missing template_vm for DisposableVM!" assert template_vm is not None, "Missing template_vm for DisposableVM!"
if not template_vm.is_templete(): if not template_vm.is_template():
print "ERROR: template_qid={0} doesn't point to a valid TempleteVM".\ print "ERROR: template_qid={0} doesn't point to a valid TempleteVM".\
format(new_vm.template_vm.qid) format(new_vm.template_vm.qid)
return False return False
@ -1196,7 +1196,7 @@ class QubesAppVm(QubesVm):
dir_path = kwargs["dir_path"] dir_path = kwargs["dir_path"]
assert template_vm is not None, "Missing template_vm for AppVM!" assert template_vm is not None, "Missing template_vm for AppVM!"
if not template_vm.is_templete(): if not template_vm.is_template():
print "ERROR: template_qid={0} doesn't point to a valid TempleteVM".\ print "ERROR: template_qid={0} doesn't point to a valid TempleteVM".\
format(new_vm.template_vm.qid) format(new_vm.template_vm.qid)
return False return False
@ -1593,7 +1593,7 @@ class QubesVmCollection(dict):
return vm return vm
def set_default_template_vm(self, vm): def set_default_template_vm(self, vm):
assert vm.is_templete(), "VM {0} is not a TempleteVM!".format(vm.name) assert vm.is_template(), "VM {0} is not a TempleteVM!".format(vm.name)
self.default_template_qid = vm.qid self.default_template_qid = vm.qid
def get_default_template_vm(self): def get_default_template_vm(self):
@ -1813,7 +1813,7 @@ class QubesVmCollection(dict):
self.default_template_qid self.default_template_qid
# Then, read in the TemplateVMs, because a reference to templete VM # Then, read in the TemplateVMs, because a reference to template VM
# is needed to create each AppVM # is needed to create each AppVM
for element in tree.findall("QubesTemplateVm"): for element in tree.findall("QubesTemplateVm"):
try: try:

View File

@ -135,7 +135,7 @@ def main():
print s print s
template_vms_worth_backingup = [ vm for vm in vms_list if (vm.is_templete() and not vm.installed_by_rpm)] template_vms_worth_backingup = [ vm for vm in vms_list if (vm.is_template() and not vm.installed_by_rpm)]
if len (template_vms_worth_backingup): if len (template_vms_worth_backingup):
for vm in template_vms_worth_backingup: for vm in template_vms_worth_backingup:
vm_sz = vm.get_disk_utilization() vm_sz = vm.get_disk_utilization()

View File

@ -47,18 +47,18 @@ fields = {
"name": {"func": "('=>' if backup_collection.get_default_template_vm() is not None\ "name": {"func": "('=>' if backup_collection.get_default_template_vm() is not None\
and vm.qid == backup_collection.get_default_template_vm().qid else '')\ and vm.qid == backup_collection.get_default_template_vm().qid else '')\
+ ('[' if vm.is_templete() else '')\ + ('[' if vm.is_template() else '')\
+ ('{' if vm.is_netvm() else '')\ + ('{' if vm.is_netvm() else '')\
+ vm.name \ + vm.name \
+ (']' if vm.is_templete() else '')\ + (']' if vm.is_template() else '')\
+ ('}' if vm.is_netvm() else '')"}, + ('}' if vm.is_netvm() else '')"},
"type": {"func": "'Tpl' if vm.is_templete() else \ "type": {"func": "'Tpl' if vm.is_template() else \
(' Net' if vm.is_netvm() else 'App')"}, (' Net' if vm.is_netvm() else 'App')"},
"updbl" : {"func": "'Yes' if vm.is_updateable() else ''"}, "updbl" : {"func": "'Yes' if vm.is_updateable() else ''"},
"template": {"func": "'n/a' if vm.is_templete() or vm.is_netvm() else\ "template": {"func": "'n/a' if vm.is_template() or vm.is_netvm() else\
backup_collection[vm.template_vm.qid].name"}, backup_collection[vm.template_vm.qid].name"},
"netvm": {"func": "'n/a' if vm.is_netvm() else\ "netvm": {"func": "'n/a' if vm.is_netvm() else\
@ -193,11 +193,11 @@ def main():
template_vm_on_host = host_collection.get_vm_by_name (templatevm_name) template_vm_on_host = host_collection.get_vm_by_name (templatevm_name)
# No template on the host? # No template on the host?
if not ((template_vm_on_host is not None) and template_vm_on_host.is_templete): if not ((template_vm_on_host is not None) and template_vm_on_host.is_template):
# Maybe the (custom) template is in the backup? # Maybe the (custom) template is in the backup?
template_vm_on_backup = backup_collection.get_vm_by_name (templatevm_name) template_vm_on_backup = backup_collection.get_vm_by_name (templatevm_name)
if not ((template_vm_on_backup is not None) and template_vm_on_backup.is_templete): if not ((template_vm_on_backup is not None) and template_vm_on_backup.is_template):
s += " <-- No matching template on the host or in the backup found!" s += " <-- No matching template on the host or in the backup found!"
there_are_missing_templates = True there_are_missing_templates = True
good_to_go = False if not (options.ignore_missing) else True good_to_go = False if not (options.ignore_missing) else True
@ -282,13 +282,13 @@ def main():
if vm.is_updateable(): if vm.is_updateable():
restore_vm_file (backup_dir, vm.rootcow_img) restore_vm_file (backup_dir, vm.rootcow_img)
elif vm.is_templete(): elif vm.is_template():
restore_vm_dir (backup_dir, vm.dir_path, qubes_templates_dir); restore_vm_dir (backup_dir, vm.dir_path, qubes_templates_dir);
else: else:
print "ERROR: VM '{0}', type='{1}': unsupported VM type!".format(vm.name, vm.type) print "ERROR: VM '{0}', type='{1}': unsupported VM type!".format(vm.name, vm.type)
# Add templates... # Add templates...
for vm in [ vm for vm in vms_to_restore if vm.is_templete()]: for vm in [ vm for vm in vms_to_restore if vm.is_template()]:
print "-> Adding Template VM {0}...".format(vm.name) print "-> Adding Template VM {0}...".format(vm.name)
updateable = vm.updateable updateable = vm.updateable
vm = host_collection.add_new_templatevm(vm.name, vm = host_collection.add_new_templatevm(vm.name,

View File

@ -68,7 +68,7 @@ def main():
if template_vm is None: if template_vm is None:
print "There is no (Templete)VM with the name '{0}'".format(options.template) print "There is no (Templete)VM with the name '{0}'".format(options.template)
exit (1) exit (1)
if not template_vm.is_templete(): if not template_vm.is_template():
print "VM '{0}' is not a TemplateVM".format(options.template) print "VM '{0}' is not a TemplateVM".format(options.template)
exit (1) exit (1)
if (options.verbose): if (options.verbose):

View File

@ -30,21 +30,21 @@ fields = {
"name": {"func": "('=>' if qvm_collection.get_default_template_vm() is not None\ "name": {"func": "('=>' if qvm_collection.get_default_template_vm() is not None\
and vm.qid == qvm_collection.get_default_template_vm().qid else '')\ and vm.qid == qvm_collection.get_default_template_vm().qid else '')\
+ ('[' if vm.is_templete() else '')\ + ('[' if vm.is_template() else '')\
+ ('<' if vm.is_disposablevm() else '')\ + ('<' if vm.is_disposablevm() else '')\
+ ('{' if vm.is_netvm() else '')\ + ('{' if vm.is_netvm() else '')\
+ vm.name \ + vm.name \
+ (']' if vm.is_templete() else '')\ + (']' if vm.is_template() else '')\
+ ('>' if vm.is_disposablevm() else '')\ + ('>' if vm.is_disposablevm() else '')\
+ ('}' if vm.is_netvm() else '')"}, + ('}' if vm.is_netvm() else '')"},
"type": {"func": "'Tpl' if vm.is_templete() else \ "type": {"func": "'Tpl' if vm.is_template() else \
(' Fw' if vm.is_fwvm() else \ (' Fw' if vm.is_fwvm() else \
(' Net' if vm.is_netvm() else ''))"}, (' Net' if vm.is_netvm() else ''))"},
"updbl" : {"func": "'Yes' if vm.is_updateable() else ''"}, "updbl" : {"func": "'Yes' if vm.is_updateable() else ''"},
"template": {"func": "'n/a' if vm.is_templete() or vm.is_netvm() else\ "template": {"func": "'n/a' if vm.is_template() or vm.is_netvm() else\
qvm_collection[vm.template_vm.qid].name"}, qvm_collection[vm.template_vm.qid].name"},
"netvm": {"func": "'n/a' if vm.is_netvm() and not vm.is_fwvm() else\ "netvm": {"func": "'n/a' if vm.is_netvm() and not vm.is_fwvm() else\
@ -142,7 +142,7 @@ def main():
# Now, the template, and all its AppVMs... # Now, the template, and all its AppVMs...
for tvm in vms_list: for tvm in vms_list:
if tvm.is_templete(): if tvm.is_template():
vms_to_display.append (tvm) vms_to_display.append (tvm)
for vm in vms_list: for vm in vms_list:
if (vm.is_appvm() or vm.is_disposablevm()) and vm.template_vm.qid == tvm.qid: if (vm.is_appvm() or vm.is_disposablevm()) and vm.template_vm.qid == tvm.qid:

View File

@ -42,7 +42,7 @@ def do_list(vm):
print fmt.format ("config", vm.conf_file) print fmt.format ("config", vm.conf_file)
if not vm.is_appvm(): if not vm.is_appvm():
print fmt.format ("root img", vm.root_img) print fmt.format ("root img", vm.root_img)
if vm.is_templete(): if vm.is_template():
print fmt.format ("root COW img", vm.rootcow_img) print fmt.format ("root COW img", vm.rootcow_img)
if vm.is_appvm(): if vm.is_appvm():
print fmt.format ("root img", vm.template_vm.root_img) print fmt.format ("root img", vm.template_vm.root_img)
@ -115,7 +115,7 @@ def set_updateable(vms, vm, args):
print "If you want to make this AppVM updateable, you must first make the Template VM nonupdateable." print "If you want to make this AppVM updateable, you must first make the Template VM nonupdateable."
return False return False
if vm.is_templete(): if vm.is_template():
# Make sure that all the AppVMs are non-updateable... # Make sure that all the AppVMs are non-updateable...
for appvm in vm.appvms.values(): for appvm in vm.appvms.values():
if appvm.is_updateable(): if appvm.is_updateable():

View File

@ -42,7 +42,7 @@ def main():
print "A VM with the name '{0}' does not exist in the system.".format(vmname) print "A VM with the name '{0}' does not exist in the system.".format(vmname)
exit(1) exit(1)
if vm.is_templete(): if vm.is_template():
dependent_vms = qvm_collection.get_vms_based_on(vm.qid) dependent_vms = qvm_collection.get_vms_based_on(vm.qid)
if len(dependent_vms) > 0: if len(dependent_vms) > 0:
print "The following AppVMs use '{0}' as a template:".format(vmname) print "The following AppVMs use '{0}' as a template:".format(vmname)

View File

@ -39,7 +39,7 @@ def main():
print "A VM with the name '{0}' does not exist in the system.".format(vmname) print "A VM with the name '{0}' does not exist in the system.".format(vmname)
exit(1) exit(1)
if not vm.is_templete(): if not vm.is_template():
print "VM '{0}' is not a TemplateVM".format(vmname) print "VM '{0}' is not a TemplateVM".format(vmname)
exit (1) exit (1)

View File

@ -46,7 +46,7 @@ def main():
print "A VM with the name '{0}' does not exist in the system.".format(vmname) print "A VM with the name '{0}' does not exist in the system.".format(vmname)
exit(1) exit(1)
if not vm.is_templete(): if not vm.is_template():
print "A VM '{0}' is not template.".format(vmname) print "A VM '{0}' is not template.".format(vmname)
exit(1) exit(1)