Пример #1
0
    def test_share_replica_create(self):
        share = "FOO_share"
        availability_zone = "BAR_availability_zone"

        api.share_replica_create(
            self.request, share, availability_zone)

        self.manilaclient.share_replicas.create.assert_called_once_with(
            share,
            availability_zone=availability_zone
        )
Пример #2
0
    def test_share_replica_create(self, share_network):
        share = "FOO_share"
        availability_zone = "BAR_availability_zone"

        api.share_replica_create(
            self.request, share, availability_zone, share_network)

        self.manilaclient.share_replicas.create.assert_called_once_with(
            share,
            availability_zone=availability_zone,
            share_network=share_network,
        )
Пример #3
0
 def handle(self, request, data):
     try:
         replica = manila.share_replica_create(request, data['share_id'],
                                               data['availability_zone'])
         message = _('Creating replica for share "%s".') % data['share_id']
         messages.success(request, message)
         return replica
     except Exception:
         redirect = reverse("horizon:project:shares:manage_replicas",
                            args=[data['share_id']])
         exceptions.handle(request,
                           _('Unable to create share replica.'),
                           redirect=redirect)
Пример #4
0
 def handle(self, request, data):
     try:
         replica = manila.share_replica_create(request,
                                               data['share_id'],
                                               data['availability_zone'])
         message = _('Creating replica for share "%s".') % data['share_id']
         messages.success(request, message)
         return replica
     except Exception:
         redirect = reverse("horizon:project:shares:manage_replicas",
                            args=[data['share_id']])
         exceptions.handle(request,
                           _('Unable to create share replica.'),
                           redirect=redirect)