parted: fix the ordering of list command

The command `parted -m -s {} print` do not print the "Type" column,
but after the "File System" column print the name of the partition.

This point that the type of the partition cannot be extracted using
parted with machine parseable output.

(cherry picked from commit f23d618e11)
This commit is contained in:
Alberto Planas 2018-09-27 14:34:50 +02:00
parent d4b90933ac
commit da2e632566
2 changed files with 18 additions and 18 deletions

View file

@ -183,8 +183,8 @@ def list_(device, unit=None):
'start': cols[1],
'end': cols[2],
'size': cols[3],
'type': cols[4],
'file system': cols[5],
'file system': cols[4],
'name': cols[5],
'flags': cols[6]}
else:
raise CommandExecutionError(

View file

@ -207,17 +207,17 @@ class PartedTestCase(TestCase, LoaderModuleMockMixin):
'end': '150MB',
'number': '1',
'start': '17.4kB',
'file system': '',
'file system': 'ext3',
'flags': 'boot',
'type': 'ext3',
'name': '',
'size': '150MB'},
'2': {
'end': '4000GB',
'number': '2',
'start': '3921GB',
'file system': '',
'file system': 'linux-swap(v1)',
'flags': '',
'type': 'linux-swap(v1)',
'name': '',
'size': '79.3GB'
}
}
@ -245,17 +245,17 @@ class PartedTestCase(TestCase, LoaderModuleMockMixin):
'end': '150MB',
'number': '1',
'start': '17.4kB',
'file system': '',
'file system': 'ext3',
'flags': 'boot',
'type': 'ext3',
'name': '',
'size': '150MB'},
'2': {
'end': '4000GB',
'number': '2',
'start': '3921GB',
'file system': '',
'file system': 'linux-swap(v1)',
'flags': '',
'type': 'linux-swap(v1)',
'name': '',
'size': '79.3GB'
}
}
@ -282,17 +282,17 @@ class PartedTestCase(TestCase, LoaderModuleMockMixin):
'end': '150MB',
'number': '1',
'start': '17.4kB',
'file system': '',
'file system': 'ext3',
'flags': 'boot',
'type': 'ext3',
'name': '',
'size': '150MB'},
'2': {
'end': '4000GB',
'number': '2',
'start': '3921GB',
'file system': '',
'file system': 'linux-swap(v1)',
'flags': '',
'type': 'linux-swap(v1)',
'name': '',
'size': '79.3GB'
}
}
@ -319,17 +319,17 @@ class PartedTestCase(TestCase, LoaderModuleMockMixin):
'end': '150MB',
'number': '1',
'start': '17.4kB',
'file system': '',
'file system': 'ext3',
'flags': 'boot',
'type': 'ext3',
'name': '',
'size': '150MB'},
'2': {
'end': '4000GB',
'number': '2',
'start': '3921GB',
'file system': '',
'file system': 'linux-swap(v1)',
'flags': '',
'type': 'linux-swap(v1)',
'name': '',
'size': '79.3GB'
}
}