Skip to content

Commit

Permalink
storage: add Volume.ephemeral property
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Sep 29, 2021
1 parent dfc909b commit 4b9fe24
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions qubesadmin/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ def rw(self, value):
self._qubesd_call('Set.rw', str(value).encode('ascii'))
self._info = None

@property
def ephemeral(self):
"""True if volume is read-write."""
try:
self._fetch_info()
except qubesadmin.exc.QubesDaemonAccessError:
raise qubesadmin.exc.QubesPropertyAccessError('ephemeral')
return self._info.get('ephemeral', 'False') == 'True'

@ephemeral.setter
def ephemeral(self, value):
"""Set rw property"""
self._qubesd_call('Set.ephemeral', str(value).encode('ascii'))
self._info = None

@property
def snap_on_start(self):
"""Create a snapshot from source on VM start."""
Expand Down

0 comments on commit 4b9fe24

Please sign in to comment.