Skip to content

Commit

Permalink
ext/block: accept any boolean value for 'read-only' option
Browse files Browse the repository at this point in the history
Be consistent with other parts of the Admin API. Especially ...Attach
accept "standard" boolean values for persistent= option.
  • Loading branch information
marmarek committed Oct 4, 2017
1 parent af60fbb commit 451cc33
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions qubes/ext/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@ def on_device_pre_attached_block(self, vm, event, device, options):
raise qubes.exc.QubesValueError(
'Invalid frontend-dev option value: ' + value)
elif option == 'read-only':
if value not in ('yes', 'no'):
raise qubes.exc.QubesValueError(
'read-only option can only have '
'\'yes\' or \'no\' value')
options[option] = (
'yes' if qubes.property.bool(None, None, value) else 'no')
elif option == 'devtype':
if value not in ('disk', 'cdrom'):
raise qubes.exc.QubesValueError(
Expand Down

0 comments on commit 451cc33

Please sign in to comment.