A share managed in HSP could have some access rules that
are not in Manila. Trying to add a rule that already exists
in backend results in an error. Also, rules in backend that
names are not "share_id + ip" can't be deleted.
Additionally, if this share has a rule only in backend and not in
Manila, trying to delete it would fail, because HSP doesn't allow
delete share when it still has rules.
Fix it by adding a check in update access when rules already
exist in backend. Check for access rule name in backend when
denying access. And cleaning all rules from backend before
deleting a share to ensure that it has no children in HSP.
Reviewed: https:/ /review. openstack. org/366310 /git.openstack. org/cgit/ openstack/ manila/ commit/ ?id=b29a0e553f4 4266fbc544f5cb9 5cf89f6cfd39db
Committed: https:/
Submitter: Jenkins
Branch: master
commit b29a0e553f44266 fbc544f5cb95cf8 9f6cfd39db
Author: Alyson Rosa <email address hidden>
Date: Tue Sep 6 16:00:29 2016 -0300
Fix access rules for managed shares in HSP driver
A share managed in HSP could have some access rules that
are not in Manila. Trying to add a rule that already exists
in backend results in an error. Also, rules in backend that
names are not "share_id + ip" can't be deleted.
Additionally, if this share has a rule only in backend and not in
Manila, trying to delete it would fail, because HSP doesn't allow
delete share when it still has rules.
Fix it by adding a check in update access when rules already
exist in backend. Check for access rule name in backend when
denying access. And cleaning all rules from backend before
deleting a share to ensure that it has no children in HSP.
Change-Id: I0c8ee5c47efe22 f004692022dd952 f301d669b06
Closes-Bug: #1620756