tools/qvm-volume import: do not retrieve old size anymore
Since admin.vm.volume.ImportWithSize method is used now, there is no need to retrieve old size anymore (to decide whether to resize or not).
This commit is contained in:
parent
65dcee424a
commit
83b1fc6c58
@ -496,17 +496,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.List', None, None)] = \
|
('testvm', 'admin.vm.volume.List', None, None)] = \
|
||||||
b'0\x00root\nprivate\n'
|
b'0\x00root\nprivate\n'
|
||||||
self.app.expected_calls[
|
|
||||||
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
|
|
||||||
b'0\x00pool=lvm\n' \
|
|
||||||
b'vid=qubes_dom0/vm-testvm-private\n' \
|
|
||||||
b'size=2147483648\n' \
|
|
||||||
b'usage=10000000\n' \
|
|
||||||
b'rw=True\n' \
|
|
||||||
b'save_on_stop=True\n' \
|
|
||||||
b'snap_on_start=False\n' \
|
|
||||||
b'revisions_to_keep=0\n' \
|
|
||||||
b'is_outdated=False\n'
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
@ -526,17 +515,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.List', None, None)] = \
|
('testvm', 'admin.vm.volume.List', None, None)] = \
|
||||||
b'0\x00root\nprivate\n'
|
b'0\x00root\nprivate\n'
|
||||||
self.app.expected_calls[
|
|
||||||
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
|
|
||||||
b'0\x00pool=lvm\n' \
|
|
||||||
b'vid=qubes_dom0/vm-testvm-private\n' \
|
|
||||||
b'size=2147483648\n' \
|
|
||||||
b'usage=10000000\n' \
|
|
||||||
b'rw=True\n' \
|
|
||||||
b'save_on_stop=True\n' \
|
|
||||||
b'snap_on_start=False\n' \
|
|
||||||
b'revisions_to_keep=0\n' \
|
|
||||||
b'is_outdated=False\n'
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
@ -557,17 +535,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.List', None, None)] = \
|
('testvm', 'admin.vm.volume.List', None, None)] = \
|
||||||
b'0\x00root\nprivate\n'
|
b'0\x00root\nprivate\n'
|
||||||
self.app.expected_calls[
|
|
||||||
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
|
|
||||||
b'0\x00pool=lvm\n' \
|
|
||||||
b'vid=qubes_dom0/vm-testvm-private\n' \
|
|
||||||
b'size=2147483648\n' \
|
|
||||||
b'usage=10000000\n' \
|
|
||||||
b'rw=True\n' \
|
|
||||||
b'save_on_stop=True\n' \
|
|
||||||
b'snap_on_start=False\n' \
|
|
||||||
b'revisions_to_keep=0\n' \
|
|
||||||
b'is_outdated=False\n'
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'512\ntest-data')] = \
|
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'512\ntest-data')] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
@ -587,17 +554,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.List', None, None)] = \
|
('testvm', 'admin.vm.volume.List', None, None)] = \
|
||||||
b'0\x00root\nprivate\n'
|
b'0\x00root\nprivate\n'
|
||||||
self.app.expected_calls[
|
|
||||||
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
|
|
||||||
b'0\x00pool=lvm\n' \
|
|
||||||
b'vid=qubes_dom0/vm-testvm-private\n' \
|
|
||||||
b'size=2147483648\n' \
|
|
||||||
b'usage=10000000\n' \
|
|
||||||
b'rw=True\n' \
|
|
||||||
b'save_on_stop=True\n' \
|
|
||||||
b'snap_on_start=False\n' \
|
|
||||||
b'revisions_to_keep=0\n' \
|
|
||||||
b'is_outdated=False\n'
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.Import', 'private', b'test-data')] = \
|
('testvm', 'admin.vm.volume.Import', 'private', b'test-data')] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
@ -617,17 +573,6 @@ class TC_00_qvm_volume(qubesadmin.tests.QubesTestCase):
|
|||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.List', None, None)] = \
|
('testvm', 'admin.vm.volume.List', None, None)] = \
|
||||||
b'0\x00root\nprivate\n'
|
b'0\x00root\nprivate\n'
|
||||||
self.app.expected_calls[
|
|
||||||
('testvm', 'admin.vm.volume.Info', 'private', None)] = \
|
|
||||||
b'0\x00pool=lvm\n' \
|
|
||||||
b'vid=qubes_dom0/vm-testvm-private\n' \
|
|
||||||
b'size=9\n' \
|
|
||||||
b'usage=1\n' \
|
|
||||||
b'rw=True\n' \
|
|
||||||
b'save_on_stop=True\n' \
|
|
||||||
b'snap_on_start=False\n' \
|
|
||||||
b'revisions_to_keep=0\n' \
|
|
||||||
b'is_outdated=False\n'
|
|
||||||
self.app.expected_calls[
|
self.app.expected_calls[
|
||||||
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
('testvm', 'admin.vm.volume.ImportWithSize', 'private', b'9\ntest-data')] = \
|
||||||
b'0\x00'
|
b'0\x00'
|
||||||
|
@ -137,7 +137,6 @@ def import_volume(args):
|
|||||||
''' Import a file into volume '''
|
''' Import a file into volume '''
|
||||||
|
|
||||||
volume = args.volume
|
volume = args.volume
|
||||||
old_size = volume.size
|
|
||||||
input_path = args.input_path
|
input_path = args.input_path
|
||||||
if input_path == '-':
|
if input_path == '-':
|
||||||
input_file = sys.stdin.buffer
|
input_file = sys.stdin.buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user