partition_table: Extend the get_partition_info command

A manufactory tool needs to retrieve info about partitions.  With a new flag - "--part_list" we can get a list of partitions with the same type/subtype and easily iterate by it.

- name and flag arguments
- added flag "--part_list" to get a list of partitions with the same type/subtype
- save prev behavior of the get_partition_info command (return the only first item)
- added host test
This commit is contained in:
KonstantinKondrashov
2020-10-01 15:10:00 +08:00
parent 48baf1294a
commit 55dc1524ee
4 changed files with 64 additions and 26 deletions

View File

@@ -166,8 +166,8 @@ class PartitionTable(list):
for p in self:
if p.type == ptype and p.subtype == subtype:
return p
return None
yield p
return
def find_by_name(self, name):
for p in self: