[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:
parent
2e8f6642f4
commit
a3fdc9e52c
@ -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'
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user