diff --git a/qubes/api/admin.py b/qubes/api/admin.py index b42d6479..f03560f3 100644 --- a/qubes/api/admin.py +++ b/qubes/api/admin.py @@ -336,9 +336,16 @@ class QubesAdminAPI(qubes.api.AbstractQubesAPI): # properties defined in API volume_properties = [ 'pool', 'vid', 'size', 'usage', 'rw', 'source', - 'save_on_stop', 'snap_on_start'] - return ''.join('{}={}\n'.format(key, getattr(volume, key)) for key in - volume_properties) + 'save_on_stop', 'snap_on_start', 'revisions_to_keep', 'is_outdated'] + + def _serialize(value): + if callable(value): + value = value() + if value is None: + value = '' + return str(value) + return ''.join('{}={}\n'.format(key, _serialize(getattr(volume, key))) + for key in volume_properties) @qubes.api.method('admin.vm.volume.ListSnapshots', no_payload=True, scope='local', read=True) diff --git a/qubes/tests/api_admin.py b/qubes/tests/api_admin.py index dcbe5522..ec59fd49 100644 --- a/qubes/tests/api_admin.py +++ b/qubes/tests/api_admin.py @@ -40,7 +40,7 @@ import qubes.storage # properties defined in API volume_properties = [ 'pool', 'vid', 'size', 'usage', 'rw', 'source', - 'save_on_stop', 'snap_on_start'] + 'save_on_stop', 'snap_on_start', 'revisions_to_keep', 'is_outdated'] class AdminAPITestCase(qubes.tests.QubesTestCase):