[focal] Fix requests.body attribute deprecation
This PS updates calls to body attribute of requests module with new text attribute. Change-Id: I696d57ed48cf28a06784c94fbdafc2644e94633c
This commit is contained in:
parent
e4cf0c17df
commit
3a06b1b604
@ -1,6 +1,8 @@
|
||||
CHANGES
|
||||
=======
|
||||
|
||||
* Update airskiff deployment gate
|
||||
* Deckhand updates
|
||||
* Removing egg-info folder
|
||||
* Sync requirements with shipyard
|
||||
* [focal] Deckhand project updates
|
||||
|
@ -51,4 +51,4 @@ class RevisionDeepDiffingResource(api_base.BaseResource):
|
||||
LOG.exception(message)
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
@ -50,4 +50,4 @@ class RevisionDiffingResource(api_base.BaseResource):
|
||||
LOG.exception(message)
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
@ -81,7 +81,7 @@ class RevisionDocumentsResource(api_base.BaseResource):
|
||||
documents = documents[:limit]
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = self.view_builder.list(documents)
|
||||
resp.text = self.view_builder.list(documents)
|
||||
|
||||
|
||||
class RenderedDocumentsResource(api_base.BaseResource):
|
||||
@ -156,4 +156,4 @@ class RenderedDocumentsResource(api_base.BaseResource):
|
||||
rendered_documents = rendered_documents[:limit]
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = self.view_builder.list(rendered_documents)
|
||||
resp.text = self.view_builder.list(rendered_documents)
|
||||
|
@ -44,7 +44,7 @@ class RevisionTagsResource(api_base.BaseResource):
|
||||
|
||||
resp_body = revision_tag_view.ViewBuilder().show(resp_tag)
|
||||
resp.status = falcon.HTTP_201
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
||||
def on_get(self, req, resp, revision_id, tag=None):
|
||||
"""Show tag details or list all tags for a revision."""
|
||||
@ -66,7 +66,7 @@ class RevisionTagsResource(api_base.BaseResource):
|
||||
|
||||
resp_body = revision_tag_view.ViewBuilder().show(resp_tag)
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
||||
@policy.authorize('deckhand:list_tags')
|
||||
def _list_all_tags(self, req, resp, revision_id):
|
||||
@ -80,7 +80,7 @@ class RevisionTagsResource(api_base.BaseResource):
|
||||
|
||||
resp_body = revision_tag_view.ViewBuilder().list(resp_tags)
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
||||
def on_delete(self, req, resp, revision_id, tag=None):
|
||||
"""Deletes a single tag or deletes all tags for a revision."""
|
||||
|
@ -61,7 +61,7 @@ class RevisionsResource(api_base.BaseResource):
|
||||
|
||||
revision_resp = self.view_builder.show(revision)
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = revision_resp
|
||||
resp.text = revision_resp
|
||||
|
||||
@policy.authorize('deckhand:list_revisions')
|
||||
@common.sanitize_params(['tag', 'order', 'sort'])
|
||||
@ -74,7 +74,7 @@ class RevisionsResource(api_base.BaseResource):
|
||||
revisions = utils.multisort(revisions, sort_by, order_by)
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = self.view_builder.list(revisions)
|
||||
resp.text = self.view_builder.list(revisions)
|
||||
|
||||
def _delete_all_barbican_secrets(self):
|
||||
filters = {'metadata.storagePolicy': 'encrypted'}
|
||||
|
@ -55,4 +55,4 @@ class RollbackResource(api_base.BaseResource):
|
||||
|
||||
revision_resp = self.view_builder.show(rollback_revision)
|
||||
resp.status = falcon.HTTP_201
|
||||
resp.body = revision_resp
|
||||
resp.text = revision_resp
|
||||
|
@ -50,7 +50,7 @@ class ValidationsResource(api_base.BaseResource):
|
||||
LOG.exception(message)
|
||||
|
||||
resp.status = falcon.HTTP_201
|
||||
resp.body = self.view_builder.show(resp_body)
|
||||
resp.text = self.view_builder.show(resp_body)
|
||||
|
||||
def on_get(self, req, resp, revision_id, validation_name=None,
|
||||
entry_id=None):
|
||||
@ -64,7 +64,7 @@ class ValidationsResource(api_base.BaseResource):
|
||||
resp_body = self._list_all_validations(req, resp, revision_id)
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = resp_body
|
||||
resp.text = resp_body
|
||||
|
||||
@policy.authorize('deckhand:show_validation')
|
||||
def _show_validation_entry(self, req, resp, revision_id, validation_name,
|
||||
@ -128,4 +128,4 @@ class ValidationsDetailsResource(api_base.BaseResource):
|
||||
raise falcon.HTTPNotFound(description=e.format_message())
|
||||
|
||||
resp.status = falcon.HTTP_200
|
||||
resp.body = self.view_builder.detail(entries)
|
||||
resp.text = self.view_builder.detail(entries)
|
||||
|
@ -26,7 +26,7 @@ class VersionsResource(api_base.BaseResource):
|
||||
no_authentication_methods = ['GET']
|
||||
|
||||
def on_get(self, req, resp):
|
||||
resp.body = {
|
||||
resp.text = {
|
||||
'v1.0': {
|
||||
'path': '/api/v1.0',
|
||||
'status': 'stable'
|
||||
|
Loading…
x
Reference in New Issue
Block a user