Skip to content

disk list have errror #26

@danny-source

Description

@danny-source

when i have first index 0: and it have NAME

/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS OSX1010                *49.9 GB    disk2

            try:
                dev = line[4]
                size = line[2].lstrip('*')
                unit = line[3]
            except IndexError:
                dev = line[3]
                size = line[1]
                unit = line[2]

try

            for line2 in line:
                match = re.search('disk', line2)
                if match:
                    break
                else:
                    idx = idx +1                
                dev = line[idx]
                unit = line[idx-1]          
                size = line[idx-2].lstrip('*')

get the last ,first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions