Merge "Return HTTP response for delete_access_rule."
This commit is contained in:
commit
d264526ed1
@ -816,10 +816,11 @@ class Proxy(proxy.Proxy):
|
||||
:param access_id: The id of the access rule to get
|
||||
:param share_id: The ID of the share
|
||||
|
||||
:rtype: ``None``
|
||||
:rtype: ``requests.models.Response`` HTTP response from internal
|
||||
requests client
|
||||
"""
|
||||
res = self._get_resource(_share_access_rule.ShareAccessRule, access_id)
|
||||
res.delete(self, share_id, ignore_missing=ignore_missing)
|
||||
return res.delete(self, share_id, ignore_missing=ignore_missing)
|
||||
|
||||
def share_group_snapshots(self, details=True, **query):
|
||||
"""Lists all share group snapshots.
|
||||
|
@ -63,7 +63,7 @@ class ShareAccessRule(resource.Resource):
|
||||
if microversion is None:
|
||||
microversion = self._get_microversion(session, action=action)
|
||||
|
||||
session.post(
|
||||
return session.post(
|
||||
url, json=body, headers=headers, microversion=microversion
|
||||
)
|
||||
|
||||
@ -76,10 +76,12 @@ class ShareAccessRule(resource.Resource):
|
||||
)
|
||||
|
||||
def delete(self, session, share_id, ignore_missing=True):
|
||||
body = {'deny_access': {'access_id': self.id}}
|
||||
url = utils.urljoin('/shares', share_id, 'action')
|
||||
body = {"deny_access": {"access_id": self.id}}
|
||||
url = utils.urljoin("/shares", share_id, "action")
|
||||
response = self._action(session, body, url)
|
||||
try:
|
||||
response = self._action(session, body, url)
|
||||
self._translate_response(response)
|
||||
except exceptions.ResourceNotFound:
|
||||
if not ignore_missing:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user