backup: make pylint happy
Use 'vm_info' instead of restore_info['dom0'], as it is available inside the loop. And break some lines to not exceed 80 chars..
This commit is contained in:
parent
c2281fefc8
commit
796a3d43ae
@ -1742,10 +1742,12 @@ class BackupRestore(object):
|
|||||||
if vm and vm_info.subdir:
|
if vm and vm_info.subdir:
|
||||||
if isinstance(vm_info, self.Dom0ToRestore) and \
|
if isinstance(vm_info, self.Dom0ToRestore) and \
|
||||||
vm_info.good_to_go:
|
vm_info.good_to_go:
|
||||||
vms_dirs.append(os.path.dirname(restore_info['dom0'].subdir))
|
vms_dirs.append(os.path.dirname(vm_info.subdir))
|
||||||
vms_size += int(restore_info['dom0'].size)
|
vms_size += int(vm_info.size)
|
||||||
if not self.options.verify_only:
|
if self.options.verify_only:
|
||||||
handlers[restore_info['dom0'].subdir] = (self._handle_dom0, None)
|
continue
|
||||||
|
|
||||||
|
handlers[vm_info.subdir] = (self._handle_dom0, None)
|
||||||
else:
|
else:
|
||||||
vms_size += int(vm_info.size)
|
vms_size += int(vm_info.size)
|
||||||
vms_dirs.append(vm_info.subdir)
|
vms_dirs.append(vm_info.subdir)
|
||||||
@ -1760,10 +1762,11 @@ class BackupRestore(object):
|
|||||||
self._handle_volume_data, vm, volume)
|
self._handle_volume_data, vm, volume)
|
||||||
size_func = functools.partial(
|
size_func = functools.partial(
|
||||||
self._handle_volume_size, vm, volume)
|
self._handle_volume_size, vm, volume)
|
||||||
handlers[os.path.join(vm_info.subdir, name + '.img')] = \
|
img_path = os.path.join(vm_info.subdir, name + '.img')
|
||||||
(data_func, size_func)
|
handlers[img_path] = (data_func, size_func)
|
||||||
handlers[os.path.join(vm_info.subdir, 'firewall.xml')] = (
|
handlers[os.path.join(vm_info.subdir, 'firewall.xml')] = (
|
||||||
functools.partial(vm_info.vm.handle_firewall_xml, vm), None)
|
functools.partial(vm_info.vm.handle_firewall_xml, vm),
|
||||||
|
None)
|
||||||
handlers[os.path.join(vm_info.subdir,
|
handlers[os.path.join(vm_info.subdir,
|
||||||
'whitelisted-appmenus.list')] = (
|
'whitelisted-appmenus.list')] = (
|
||||||
functools.partial(self._handle_appmenus_list, vm), None)
|
functools.partial(self._handle_appmenus_list, vm), None)
|
||||||
|
Loading…
Reference in New Issue
Block a user