コード例 #1
0
    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)
コード例 #2
0
ファイル: forms.py プロジェクト: ajarr/manila-ui
 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)
コード例 #3
0
ファイル: forms.py プロジェクト: hp-storage/manila-ui
 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)