diff --git a/doc/manpages/qvm-volume.rst b/doc/manpages/qvm-volume.rst index 7ec474a..1231cf7 100644 --- a/doc/manpages/qvm-volume.rst +++ b/doc/manpages/qvm-volume.rst @@ -34,7 +34,7 @@ Commands list ^^^^ -| :command:`qvm-volume list` [-h] [--verbose] [--quiet] [-p *POOL_NAME*] [-i] [*VMNAME* [*VMNAME* ...]] +| :command:`qvm-volume list` [-h] [--verbose] [--quiet] [-p *POOL_NAME*] [*VMNAME* [*VMNAME* ...]] List block devices. By default the internal devices are hidden. When the stdout is connected to a TTY `qvm-volume list` will print a pretty table by @@ -45,10 +45,6 @@ passed or stdout is redirected to a pipe or file. list volumes from specified pool -.. option:: -i, --internal - - list internal devices - .. option:: --full print domain names diff --git a/qubesadmin/storage.py b/qubesadmin/storage.py index 520f80d..f2bb1d4 100644 --- a/qubesadmin/storage.py +++ b/qubesadmin/storage.py @@ -165,12 +165,6 @@ class Volume(object): return self._info['source'] return None - @property - def internal(self): - '''If `True` volume is hidden when qvm-block is used''' - self._fetch_info() - return self._info['internal'] == 'True' - @property def revisions_to_keep(self): '''Number of revisions to keep around''' diff --git a/qubesadmin/tests/storage.py b/qubesadmin/tests/storage.py index df4243a..aa1f7fb 100644 --- a/qubesadmin/tests/storage.py +++ b/qubesadmin/tests/storage.py @@ -43,7 +43,6 @@ class TestVMVolume(qubesadmin.tests.QubesTestCase): b'snap_on_start=True\n' \ b'save_on_stop=True\n' \ b'source=\n' \ - b'internal=True\n' \ b'revisions_to_keep=3\n' def test_000_qubesd_call(self): @@ -110,11 +109,6 @@ class TestVMVolume(qubesadmin.tests.QubesTestCase): self.assertEqual(self.vol.source, 'test-pool:other-id') self.assertAllCalled() - def test_019_internal(self): - self.expect_info() - self.assertEqual(self.vol.internal, True) - self.assertAllCalled() - def test_020_revisions_to_keep(self): self.expect_info() self.assertEqual(self.vol.revisions_to_keep, 3) @@ -205,7 +199,6 @@ class TestPoolVolume(TestVMVolume): b'snap_on_start=True\n' \ b'save_on_stop=True\n' \ b'source=\n' \ - b'internal=True\n' \ b'revisions_to_keep=3\n' def test_001_fetch_info(self): diff --git a/qubesadmin/tests/tools/qvm_volume.py b/qubesadmin/tests/tools/qvm_volume.py index 8c8b183..de65951 100644 --- a/qubesadmin/tests/tools/qvm_volume.py +++ b/qubesadmin/tests/tools/qvm_volume.py @@ -38,7 +38,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): (b'pool=pool-file\n' if vol == 'root' else b'pool=other-pool\n') + \ b'vid=' + vm.encode() + b'-' + vol.encode() + b'\n' \ - b'internal=True\n' \ b'size=10737418240\n' self.app.expected_calls[ (vm, 'admin.vm.volume.ListSnapshots', vol, None)] = \ @@ -51,7 +50,7 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): self.setup_expected_calls_for_list() with qubesadmin.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, - qubesadmin.tools.qvm_volume.main(['ls', '-i'], app=self.app)) + qubesadmin.tools.qvm_volume.main(['ls'], app=self.app)) self.assertEqual(stdout.getvalue(), 'POOL:VOLUME VMNAME VOLUME_NAME ' 'REVERT_POSSIBLE\n' @@ -66,7 +65,7 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): self.setup_expected_calls_for_list(vms=('vm1',)) with qubesadmin.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, - qubesadmin.tools.qvm_volume.main(['ls', '-i', 'vm1'], + qubesadmin.tools.qvm_volume.main(['ls', 'vm1'], app=self.app)) self.assertEqual(stdout.getvalue(), 'POOL:VOLUME VMNAME VOLUME_NAME REVERT_POSSIBLE\n' @@ -84,7 +83,7 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): with qubesadmin.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, qubesadmin.tools.qvm_volume.main( - ['ls', '-i', '-p', 'pool-file', 'vm1'], + ['ls', '-p', 'pool-file', 'vm1'], app=self.app)) self.assertEqual(stdout.getvalue(), 'POOL:VOLUME VMNAME VOLUME_NAME REVERT_POSSIBLE\n' @@ -104,7 +103,7 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): with qubesadmin.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, qubesadmin.tools.qvm_volume.main( - ['ls', '-i', '-p', 'pool-file'], + ['ls', '-p', 'pool-file'], app=self.app)) self.assertEqual(stdout.getvalue(), 'POOL:VOLUME VMNAME VOLUME_NAME REVERT_POSSIBLE\n' @@ -123,7 +122,7 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase): with qubesadmin.tests.tools.StdoutBuffer() as stdout: self.assertEqual(0, qubesadmin.tools.qvm_volume.main( - ['ls', '-i', 'vm1', 'vm2'], app=self.app)) + ['ls', 'vm1', 'vm2'], app=self.app)) self.assertEqual(stdout.getvalue(), 'POOL:VOLUME VMNAME VOLUME_NAME REVERT_POSSIBLE\n' 'other-pool:vm1-private vm1 private Yes\n' diff --git a/qubesadmin/tools/qvm_volume.py b/qubesadmin/tools/qvm_volume.py index 408891f..fb1b168 100644 --- a/qubesadmin/tools/qvm_volume.py +++ b/qubesadmin/tools/qvm_volume.py @@ -99,9 +99,6 @@ def list_volumes(args): # only specified pools volumes = [v for v in volumes if v.pool in args.pools] - if not args.internal: # hide internal volumes - volumes = [v for v in volumes if not v.internal] - vd_dict = {} for volume in volumes: volume_data = VolumeData(volume) @@ -160,8 +157,6 @@ def init_list_parser(sub_parsers): help='list storage volumes') list_parser.add_argument('-p', '--pool', dest='pools', action=qubesadmin.tools.PoolsAction) - list_parser.add_argument('-i', '--internal', action='store_true', - help='Show internal volumes') list_parser.add_argument( '--full', action='store_true', help='print full line for each POOL_NAME:VOLUME_ID & vm combination')