Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
Build 46 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
excelero-andreas authored Oct 30, 2018
1 parent 36fb69c commit f062bb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions nvmesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import re
import requests

__version__ = '45'
__version__ = '46'

RAID_LEVELS = {
'lvm': 'LVM/JBOD',
Expand All @@ -53,7 +53,8 @@
'0x1344': 'Micron',
'0x15b7': 'SanDisk',
'0x1179': 'Toshiba',
'0x144D': 'Samsung'
'0x144d': 'Samsung',
'0x1bb1': 'Seagate'
}

WARNINGS = {
Expand Down Expand Up @@ -843,7 +844,7 @@ def do_show(self, args):
elif args.nvmesh_object == 'drivemodel':
self.poutput(show_drive_models(args.detail))
elif args.nvmesh_object == 'version':
self.poutput(__version__)
self.poutput(": ".join(["Nvmesh CLI version", __version__]))
elif args.nvmesh_object == 'license':
self.ppaged(__license__)
cli_exit.validate_exit()
Expand Down Expand Up @@ -3007,15 +3008,21 @@ def show_drives(details, targets, tsv):
else:
target_details = json.loads(nvmesh.get_server_by_id(target))
for disk in target_details['disks']:
vendor = NVME_VENDORS.get(disk['Vendor'], disk['Vendor'])
vendor = disk['Vendor'] if not disk['Vendor'] in NVME_VENDORS else NVME_VENDORS[disk['Vendor']]
status = u'\u2705' if disk["status"].lower() == "ok" else u'\u274C'
if 'isOutOfService' in disk:
in_service = formatter.red("No")
status = "n/a"
else:
in_service = formatter.green("Yes")
if details:
drive_list.append([vendor,
disk['Model'],
disk['diskID'],
humanfriendly.format_size((disk['block_size'] * disk['blocks']),
binary=True),
status,
in_service,
humanfriendly.format_size(disk['block_size'], binary=True),
" ".join([str(100 - int((disk['Available_Spare'].split("_")[0]))), "%"]),
target,
Expand All @@ -3029,6 +3036,7 @@ def show_drives(details, targets, tsv):
humanfriendly.format_size((disk['block_size'] * disk['blocks']),
binary=True),
status,
in_service,
target])
if tsv:
return formatter.print_tsv(drive_list)
Expand All @@ -3039,6 +3047,7 @@ def show_drives(details, targets, tsv):
'Drive ID',
'Size',
'Status',
'In Service',
'Sector Size',
'Wear',
'Target',
Expand All @@ -3051,6 +3060,7 @@ def show_drives(details, targets, tsv):
'Drive ID',
'Size',
'Status',
'In Service',
'Target'])


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

setup(
name='nvmesh-shell',
version='45',
version='46',
author='Excelero, Inc. - Andreas Krause',
url='https://github.com/Excelero/nvmesh-shell',
description='Excelero NVMesh interactive shell and cli tool.',
Expand Down

0 comments on commit f062bb3

Please sign in to comment.