[focal] Fix requests.body attribute deprecation

This PS updates calls to body attribute of requests module with new text
attribute.

Change-Id: I8f69d18a0ac5a0065072642a58364584392bde37
This commit is contained in:
Sergiy Markin 2023-05-10 21:38:01 +00:00
parent 2e8f6642f4
commit a3fdc9e52c
5 changed files with 5 additions and 5 deletions

View File

@ -72,7 +72,7 @@ class VersionsResource(BaseResource):
"""
def on_get(self, req, resp):
resp.body = self.to_json(
resp.text = self.to_json(
{'v1.0': {
'path': '/api/v1.0',
'status': 'stable'

View File

@ -89,7 +89,7 @@ class JoinScriptsResource(BaseResource):
builder = Builder(config)
script = builder.build_node_script(hostname)
resp.body = script
resp.text = script
resp.content_type = 'text/x-shellscript'
resp.status = falcon.HTTP_200

View File

@ -40,5 +40,5 @@ class NodeLabelsResource(BaseResource):
kubeclient = KubeClient()
response = kubeclient.update_node_labels(node_name, json_data)
resp.body = response
resp.text = response
resp.status = falcon.HTTP_200

View File

@ -105,7 +105,7 @@ def format_error_resp(req,
'retry': retry
}
resp.body = json.dumps(error_response, default=str)
resp.text = json.dumps(error_response, default=str)
resp.content_type = 'application/json'
resp.status = status_code

View File

@ -78,4 +78,4 @@ class ValidationMessage(Message):
def update_response(self, resp):
output = self.get_output()
resp.status = output['code']
resp.body = json.dumps(output)
resp.text = json.dumps(output)