Skip to content

Commit

Permalink
improved error messages in disks module when 45Drives gateway is enco…
Browse files Browse the repository at this point in the history
…untered
  • Loading branch information
markdhooper committed Jun 23, 2023
1 parent e89b132 commit a75a9a3
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 15 deletions.
21 changes: 19 additions & 2 deletions 45drives-disks/public/scripts/disk_info
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,24 @@ import json
import sys
import re

def getDiskInfo(path):
def loadServerInfo():
json_path = "/etc/45drives/server_info/server_info.json"
server_info = {}
if os.path.exists(json_path):
f = open(json_path, "r")
server_info = json.load(f)
f.close()
return server_info
else:
print("/etc/45drives/server_info/server_info.json not found.")
sys.exit(1)

def getDiskInfo(path,server_info):
if not os.path.isfile(path):
if "Chassis Size" in server_info.keys() and server_info["Chassis Size"] in ["2UGW"]:
print(f"This program is intended to display disk information for servers with dedicated storage bays.",file=sys.stderr)
print(f"Use command line utilities such as lsblk to see disk information for Ceph Gateways.",file=sys.stderr)
sys.exit(1)
print(f"Error opening {path}. Run `dmap`.",file=sys.stderr)
sys.exit(1)

Expand Down Expand Up @@ -38,7 +54,8 @@ def disk_type(device_path):
return ("HDD" if is_rotational else "SSD")

def main():
diskInfo = getDiskInfo("/etc/vdev_id.conf")
server_info = loadServerInfo()
diskInfo = getDiskInfo("/etc/vdev_id.conf",server_info)
print(json.dumps(diskInfo,indent=4))


Expand Down
2 changes: 1 addition & 1 deletion 45drives-disks/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export default {
</h3>
</div>
<div class="card-body flex flex-col gap-4">
<h3>This module is designed to work with 45Drives servers.</h3>
<h3>This module is designed to work with 45Drives servers which feature dedicated storage bays.</h3>
<div>Consult any notifications for potential fixes.</div>
<div>
If you are still experiencing issues, contact 45Drives Support or
Expand Down
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
## cockpit-45drives-hardware 2.3.1-3
## cockpit-45drives-hardware 2.3.2-1

* added support for X12SPL-F Motherboards in all modules
* updated dmidecode dependency to require 3.3 or later
* updated motherboard layout files to include mask image paths
* Updated disks module to inform user that Ceph Gateways are not compatible
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
PLUGIN_SRCS=

# For installing to a remote machine for testing with `make install-remote`
REMOTE_TEST_HOST=192.168.207.88
REMOTE_TEST_HOST=192.168.208.195
REMOTE_TEST_USER=root

# Restarts cockpit after install
Expand Down
14 changes: 7 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"__version": "45D-R1",
"name": "cockpit-45drives-hardware",
"title": "cockpit-45drives-hardware",
"prerelease": false,
"version": "2.3.1",
"buildVersion": "3",
"prerelease": true,
"version": "2.3.2",
"buildVersion": "1",
"author": "Mark Hooper <[email protected]>",
"url": "https://github.com/45Drives/cockpit-hardware",
"category": "utils",
Expand All @@ -30,7 +30,7 @@
"dmidecode (>=3.3)",
"ipmitool",
"lshw",
"45drives-tools (>= 2.2.0)",
"45drives-tools (>= 2.2.3)",
"iproute2"
],
"el": [
Expand All @@ -41,7 +41,7 @@
"dmidecode >= 3.3",
"ipmitool",
"lshw",
"45drives-tools >= 2.2.0"
"45drives-tools >= 2.2.3"
]
},
"releases": [
Expand All @@ -58,8 +58,8 @@
],
"changelog": {
"urgency": "medium",
"version": "2.3.1",
"buildVersion": "3",
"version": "2.3.2",
"buildVersion": "1",
"ignore": [],
"date": null,
"packager": "Mark Hooper <[email protected]>",
Expand Down
2 changes: 2 additions & 0 deletions packaging/el8/main.spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ make DESTDIR=%{buildroot} install
/usr/lib/udev/rules.d/68-cockpit-45drives-disks.rules

%changelog
* Fri Jun 23 2023 Mark Hooper <[email protected]> 2.3.2-1
- Updated disks module to inform user that Ceph Gateways are not compatible
* Wed Mar 22 2023 Mark Hooper <[email protected]> 2.3.1-3
- added support for X12SPL-F Motherboards in all modules
- updated dmidecode dependency to require 3.3 or later
Expand Down
6 changes: 6 additions & 0 deletions packaging/focal/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cockpit-45drives-hardware (2.3.2-1focal) focal; urgency=medium

* Updated disks module to inform user that Ceph Gateways are not compatible

-- Mark Hooper <[email protected]> Fri, 23 Jun 2023 08:43:38 -0300

cockpit-45drives-hardware (2.3.1-3focal) focal; urgency=medium

* added support for X12SPL-F Motherboards in all modules
Expand Down

0 comments on commit a75a9a3

Please sign in to comment.