Skip to content

Commit

Permalink
Update disk check
Browse files Browse the repository at this point in the history
  • Loading branch information
sujinmkang committed Jan 20, 2022
1 parent 35b5cf1 commit 237caf7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions ssdutil/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,18 @@ def ssdutil():
sys.exit(1)

parser = argparse.ArgumentParser()
parser.add_argument("-d", "--device", help="Device name to show health info", default=None)
parser.add_argument("-d", "--device", help="Device name to show health info", default=get_default_disk())
parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Show verbose output (some additional parameters)")
parser.add_argument("-e", "--vendor", action="store_true", default=False, help="Show vendor output (extended output if provided by platform vendor)")
args = parser.parse_args()

if args.device:
disk_device = args.device
else:
disk_device = get_default_disk()

disk_type = get_disk_type(disk_device)
if disk_type != DISK_TYPE_SSD:
disk_type = get_disk_type(args.device)
if DISK_TYPE_SSD not in disk_type:
print("Disk type is not SSD")
sys.exit(1)

ssd = import_ssd_api(disk_device)
ssd = import_ssd_api(args.device)


print("Device Model : {}".format(ssd.get_model()))
if args.verbose:
Expand Down

0 comments on commit 237caf7

Please sign in to comment.