mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
d4b90933ac
commit
da2e632566
2 changed files with 18 additions and 18 deletions
|
@ -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(
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue