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 )
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, )
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)