On 11/26/2017 05:56 PM, Marek Marczykowski-Górecki wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Sun, Nov 26, 2017 at 05:17:26PM -0500, Chris Laprise wrote:
I'm trying to fix issue #3303 (inability to use --verify-only with
qvm-backup-restore) but to do that I need to supply vm objects that are not
actual vms. Otherwise, the tool can't cope with archives containing vm names
not present in the live system.
I'm not sure what is the right approach for instantiating 'dummy' vm classes
(or at least ones that will be useful to the restore tool).
Quick-fix me wants to do: dummyvm = qubesadmin.vm.QubesVM(None, "dummy1")
...but I want it to be correct.
This will raise NotImplementedError on the first try to call any
AdminAPI method - like getting property. Better create DummyQubes class,
being subclass of QubesBase (see qubesadmin/app.py), and put empty
qubesd_call method there. Then use that instead of None for QubesVM
constructor. Something like this:
class DummyQubes(qubesadmin.app.QubesBase):
def qubesd_call(self, *args, **kwargs):
pass
dummy_app = DummyQubes()
dummyvm = qubesadmin.vm.QubesVM(dummy_app, "dummy1")
It works, but this seems to work as well:
new_vm = self.backup_app.domains[vm_name]
This may be preferable to adding a dummy class definition.
--
Chris Laprise, [email protected]
https://github.com/tasket
https://twitter.com/ttaskett
PGP: BEE2 20C5 356E 764A 73EB 4AB3 1DC4 D106 F07F 1886
--
You received this message because you are subscribed to the Google Groups
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qubes-devel/9005559c-2a07-5817-fb97-410c04c39763%40posteo.net.
For more options, visit https://groups.google.com/d/optout.