Cater for certificate delete
Return error if user initiates certificae delete for
OP940 relase that has redfish support.
Certificate delete is not present in OP940 rather
user need to use certificate replace.
Tested:
-------OP930-------
bash-4.2$ python openbmctool.py -H $BMC_IP -U aaa -P ppp certificate
delete server https
Attempting login...
Deleting certificate url=https://$BMC_IP/xyz/openbmc_project/certs/server/https
Delete complete.
None
User root has been logged out
-------OP940-------
bash-4.2$ python openbmctool.py -H $BMC_IP -U aaa -P ppp certificate
Attempting login...
Not supported
User root has been logged out
Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: I2b1906190a59dc7f10781eb78744d7350baae169
diff --git a/thalerj/openbmctool.py b/thalerj/openbmctool.py
index a9ea855..686796b 100755
--- a/thalerj/openbmctool.py
+++ b/thalerj/openbmctool.py
@@ -2580,7 +2580,8 @@
@param args: contains additional arguments used by the certificate delete sub command
@param session: the active session to use
"""
-
+ if redfishSupportPresent(host, session):
+ return "Not supported, please use certificate replace instead";
httpHeader = {'Content-Type': 'multipart/form-data'}
httpHeader.update(xAuthHeader)
url = "https://" + host + "/xyz/openbmc_project/certs/" + args.type.lower() + "/" + args.service.lower()
@@ -2595,8 +2596,7 @@
print(resp.text)
return "Failed to delete the certificate"
else:
- print("Delete complete.")
-
+ print("Delete complete.")
def enableLDAP(host, args, session):
"""