Example #1
0
 def _update_balancer(self, params):
     try:
         return self.connection.request('/api/grid/loadbalancer/edit',
                 method='POST',
                 params=params)
     except Exception, err:
         if "Update already pending" in str(err):
             raise LibcloudLBImmutableError("Balancer is immutable", GoGridLBDriver)
Example #2
0
 def destroy_balancer(self, balancer):
     try:
         resp = self.connection.request('/api/grid/loadbalancer/delete',
                 method='POST', params={'id': balancer.id})
     except Exception, err:
         if "Update request for LoadBalancer" in str(err):
             raise LibcloudLBImmutableError("Cannot delete immutable object",
                     GoGridLBDriver)
         else:
             raise
Example #3
0
    def _update_balancer(self, params):
        try:
            return self.connection.request("/api/grid/loadbalancer/edit",
                                           method="POST",
                                           params=params)
        except Exception as e:
            if "Update already pending" in str(e):
                raise LibcloudLBImmutableError("Balancer is immutable",
                                               GoGridLBDriver)

            raise LibcloudError(value="Exception: %s" % str(e), driver=self)
Example #4
0
    def _update_balancer(self, params):
        try:
            return self.connection.request('/api/grid/loadbalancer/edit',
                                           method='POST',
                                           params=params)
        except Exception:
            e = sys.exc_info()[1]
            if "Update already pending" in str(e):
                raise LibcloudLBImmutableError("Balancer is immutable",
                                               GoGridLBDriver)

        raise LibcloudError(value='Exception: %s' % str(err), driver=self)
Example #5
0
    def destroy_balancer(self, balancer):
        try:
            resp = self.connection.request(
                "/api/grid/loadbalancer/delete",
                method="POST",
                params={"id": balancer.id},
            )
        except Exception as e:
            if "Update request for LoadBalancer" in str(e):
                raise LibcloudLBImmutableError(
                    "Cannot delete immutable object", GoGridLBDriver)
            else:
                raise

        return resp.status == 200