def test_share_update(self, name, description, is_public): api.share_update(self.request, self.id, name, description, is_public) self.manilaclient.shares.update.assert_called_once_with( self.id, display_name=name, display_description=description, is_public=is_public)
def handle(self, request, data): share_id = self.initial['share_id'] try: share = manila.share_get(self.request, share_id) manila.share_update( request, share, data['name'], data['description'], is_public=data['is_public']) message = _('Updating share "%s"') % data['name'] messages.success(request, message) return True except Exception: redirect = reverse("horizon:project:shares:index") exceptions.handle(request, _('Unable to update share.'), redirect=redirect)