Skip to content

Commit be29368

Browse files
committed
qvm_device: simplify options string, use -o for all options
Drop the --ro special case in _build_options_str: output -o read-only=yes like any other option instead.
1 parent 1bc239b commit be29368

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

qubesadmin/tests/tools/qvm_device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def test_032_assign_ask_and_options(self):
379379
app=self.app)
380380
self.assertIn('Assigned.', buf.getvalue())
381381
self.assertIn('now restart domain', buf.getvalue())
382-
self.assertIn('--ro', buf.getvalue())
382+
self.assertIn('-o read-only=yes', buf.getvalue())
383383
self.assertAllCalled()
384384

385385
def test_032b_assign_option_in_hint(self):

qubesadmin/tools/qvm_device.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,7 @@ def assign_device(args):
358358

359359
def _build_options_str(options):
360360
"""Build CLI option flags string from assignment options dict."""
361-
parts = []
362-
if options.get("read-only", "").lower() in ("yes", "true", "1"):
363-
parts.append("--ro")
364-
for key, value in options.items():
365-
if key == "read-only":
366-
continue
367-
parts.append(f"-o {key}={value}")
361+
parts = [f"-o {key}={value}" for key, value in options.items()]
368362
return (" " + " ".join(parts)) if parts else ""
369363

370364

0 commit comments

Comments
 (0)