qubes/vm: minor
This commit is contained in:
parent
2d8d78bebe
commit
ed6e69b77e
@ -338,9 +338,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
try:
|
try:
|
||||||
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
self._libvirt_domain = self.app.vmm.libvirt_conn.lookupByUUID(
|
||||||
self.uuid.bytes)
|
self.uuid.bytes)
|
||||||
except libvirt.libvirtError:
|
except libvirt.libvirtError as e:
|
||||||
if self.app.vmm.libvirt_conn.virConnGetLastError()[0] == \
|
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
||||||
libvirt.VIR_ERR_NO_DOMAIN:
|
|
||||||
self._update_libvirt_domain()
|
self._update_libvirt_domain()
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
@ -462,8 +461,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
self.volume_config[name][k] = v
|
self.volume_config[name][k] = v
|
||||||
elif volume_config:
|
elif volume_config:
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
'volume_config specified, but {} did not expect that.' %
|
'volume_config specified, but {} did not expect that.'.format(
|
||||||
self.__class__.__name__)
|
self.__class__.__name__))
|
||||||
|
|
||||||
import qubes.vm.adminvm # pylint: disable=redefined-outer-name
|
import qubes.vm.adminvm # pylint: disable=redefined-outer-name
|
||||||
|
|
||||||
@ -929,8 +928,10 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
call_kwargs['stdout'] = null
|
call_kwargs['stdout'] = null
|
||||||
|
|
||||||
if passio_popen:
|
if passio_popen:
|
||||||
popen_kwargs = {'stdout': subprocess.PIPE}
|
popen_kwargs = {
|
||||||
popen_kwargs['stdin'] = subprocess.PIPE
|
'stdout': subprocess.PIPE,
|
||||||
|
'stdin': subprocess.PIPE
|
||||||
|
}
|
||||||
if passio_stderr:
|
if passio_stderr:
|
||||||
popen_kwargs['stderr'] = subprocess.PIPE
|
popen_kwargs['stderr'] = subprocess.PIPE
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user