Exemple #1
0
 def handle(self, request, context):
     try:
         for project in self.context["projects_remove"]:
             manila.share_type_access_remove(request, self.context["id"], project)
         for project in self.context["projects_add"]:
             manila.share_type_access_add(request, self.context["id"], project)
         return True
     except Exception:
         exceptions.handle(request, _("Unable to update share type."))
         return False
Exemple #2
0
    def test_share_type_access_add(self):
        share_type_id = "fake_share_type_id"
        project_id = "fake_project_id"

        api.share_type_access_add(self.request, share_type_id, project_id)

        mock_share_type_access_add = (
            self.manilaclient.share_type_access.add_project_access)

        mock_share_type_access_add.assert_called_once_with(
            share_type_id, project_id)
Exemple #3
0
 def handle(self, request, context):
     try:
         for project in self.context['projects_remove']:
             manila.share_type_access_remove(request, self.context['id'],
                                             project)
         for project in self.context['projects_add']:
             manila.share_type_access_add(request, self.context['id'],
                                          project)
         return True
     except Exception:
         exceptions.handle(request, _('Unable to update share type.'))
         return False