Skip to content

Commit fa3aa90

Browse files
committed
Add free-form text to qube for notes, comments, ...
qubesadmin part of adding free-form text to each qube for comments, notes, descriptions, remarks, reminders, etc. fixes: QubesOS/qubes-issues#899
1 parent 581531c commit fa3aa90

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

qubesadmin/vm/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,20 @@ def klass(self):
394394
self._klass = super().klass
395395
return self._klass
396396

397+
def get_notes(self) -> str:
398+
''' Get qube notes '''
399+
try:
400+
response = self.qubesd_call(self._method_dest, 'admin.vm.notes.Get')
401+
except qubesadmin.exc.QubesDaemonNoResponseError:
402+
raise qubesadmin.exc.QubesPropertyAccessError('notes')
403+
return response.decode()
404+
405+
def set_notes(self, notes: str):
406+
''' Set qube notes '''
407+
self.qubesd_call(self._method_dest, 'admin.vm.notes.Set', \
408+
payload = str(notes).encode('ascii'))
409+
410+
397411
class DispVMWrapper(QubesVM):
398412
'''Wrapper class for new DispVM, supporting only service call
399413

0 commit comments

Comments
 (0)