def _call(self, method_name, **kwargs): try: return rpc.call(self.context, self._get_routing_key(), {"method": method_name, "args": kwargs}) except Exception as e: LOG.error(e) raise exception.GuestError(original_message=str(e))
def _call(self, method_name, **kwargs): LOG.debug("Calling %s" % method_name) try: result = rpc.call(self.context, self._get_routing_key(), {"method": method_name, "args": kwargs}) LOG.debug("Result is %s" % result) return result except Exception as e: LOG.error(e) raise exception.GuestError(original_message=str(e))
def _call(self, method_name, timeout_sec, **kwargs): LOG.debug("Calling %s" % method_name) timeout = Timeout(timeout_sec) try: result = rpc.call(self.context, self._get_routing_key(), {'method': method_name, 'args': kwargs}) LOG.debug("Result is %s" % result) return result except Exception as e: LOG.error(e) raise exception.GuestError(original_message=str(e)) except Timeout as t: if t is not timeout: raise else: raise exception.GuestTimeout() finally: timeout.cancel()