|
|
|
@ -38,7 +38,7 @@ class RedfishUtils(object):
|
|
|
|
|
return {'ret': False, 'msg': "URL Error: %s" % e.reason}
|
|
|
|
|
# Almost all errors should be caught above, but just in case
|
|
|
|
|
except:
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error"}
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error %s" % str(e)}
|
|
|
|
|
return {'ret': True, 'data': data}
|
|
|
|
|
|
|
|
|
|
def post_request(self, uri, pyld, hdrs):
|
|
|
|
@ -55,7 +55,7 @@ class RedfishUtils(object):
|
|
|
|
|
return {'ret': False, 'msg': "URL Error: %s" % e.reason}
|
|
|
|
|
# Almost all errors should be caught above, but just in case
|
|
|
|
|
except:
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error"}
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error %s" % str(e)}
|
|
|
|
|
return {'ret': True, 'resp': resp}
|
|
|
|
|
|
|
|
|
|
def patch_request(self, uri, pyld, hdrs):
|
|
|
|
@ -72,7 +72,7 @@ class RedfishUtils(object):
|
|
|
|
|
return {'ret': False, 'msg': "URL Error: %s" % e.reason}
|
|
|
|
|
# Almost all errors should be caught above, but just in case
|
|
|
|
|
except:
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error"}
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error %s" % str(e)}
|
|
|
|
|
return {'ret': True, 'resp': resp}
|
|
|
|
|
|
|
|
|
|
def delete_request(self, uri, pyld, hdrs):
|
|
|
|
@ -89,7 +89,7 @@ class RedfishUtils(object):
|
|
|
|
|
return {'ret': False, 'msg': "URL Error: %s" % e.reason}
|
|
|
|
|
# Almost all errors should be caught above, but just in case
|
|
|
|
|
except:
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error"}
|
|
|
|
|
return {'ret': False, 'msg': "Unknown error %s" % str(e)}
|
|
|
|
|
return {'ret': True, 'resp': resp}
|
|
|
|
|
|
|
|
|
|
def _init_session(self):
|
|
|
|
|