mgmt: minor adjustments

per @woju review

QubesOS/qubes-issues#2622
This commit is contained in:
Marek Marczykowski-Górecki 2017-03-28 15:25:10 +02:00
parent 2c115bb648
commit ad456a3387
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -271,10 +271,11 @@ class QubesMgmt(object):
def vm_volume_listsnapshots(self):
assert self.arg in self.dest.volumes.keys()
self.fire_event_for_permission()
volume = self.dest.volumes[self.arg]
return ''.join('{}\n'.format(revision) for revision in volume.revisions)
revisions = [revision for revision in volume.revisions]
revisions = self.fire_event_for_filter(revisions)
return ''.join('{}\n'.format(revision) for revision in revisions)
@asyncio.coroutine
def vm_volume_revert(self, untrusted_payload):
@ -369,13 +370,11 @@ class QubesMgmt(object):
driver_parameters = qubes.storage.driver_parameters(self.arg)
assert all(key in driver_parameters for key in untrusted_pool_config)
# option names validated, validation of option values is delegated to
# extension (through events mechanism)
self.fire_event_for_permission(name=pool_name,
untrusted_pool_config=untrusted_pool_config)
pool_config = untrusted_pool_config
self.fire_event_for_permission(name=pool_name,
pool_config=pool_config)
self.app.add_pool(name=pool_name, driver=self.arg, **pool_config)
self.app.save()
@ -436,7 +435,7 @@ class QubesMgmt(object):
# besides prefix, only hex digits are allowed
assert all(x in string.hexdigits for x in untrusted_payload[2:])
# TODO: try to avoid creating label too similar to existing one?
# SEE: #2732
color = untrusted_payload
self.fire_event_for_permission(color=color)