diff --git a/cinder/volume/drivers/dell_emc/powerstore/client.py b/cinder/volume/drivers/dell_emc/powerstore/client.py index d307c94f859..04670518bb1 100644 --- a/cinder/volume/drivers/dell_emc/powerstore/client.py +++ b/cinder/volume/drivers/dell_emc/powerstore/client.py @@ -85,8 +85,6 @@ class PowerStoreClient(object): payload=None, params=None, log_response_data=True): - if not payload: - payload = {} if not params: params = {} request_params = { @@ -94,7 +92,7 @@ class PowerStoreClient(object): "verify": self._verify_cert, "params": params } - if method != "GET": + if payload and method != "GET": request_params["data"] = json.dumps(payload) request_url = self.base_url + url r = requests.request(method, request_url, **request_params) diff --git a/releasenotes/notes/powerstore-request-data-validation-6268f2ed07b7bf40.yaml b/releasenotes/notes/powerstore-request-data-validation-6268f2ed07b7bf40.yaml new file mode 100644 index 00000000000..b238d070c87 --- /dev/null +++ b/releasenotes/notes/powerstore-request-data-validation-6268f2ed07b7bf40.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + PowerStore driver `bug #1981068 + `_: Fixed + request data validation for the REST client.