def unplug(self, instance, network, mapping): dev = self.get_dev_name(mapping["vif_uuid"]) client = VIFINFOClient(FLAGS.quantum_host, FLAGS.quantum_port) client.delete_vifinfo(mapping["vif_uuid"]) try: utils.execute("ovs-vsctl", "del-port", FLAGS.libvirt_ovs_bridge, dev, run_as_root=True) utils.execute("ip", "link", "delete", dev, run_as_root=True) except exception.ProcessExecutionError: LOG.warning(_("Failed while unplugging vif of instance '%s'"), instance["name"]) raise
def log_error(self, exception): """Something went wrong. Check to see if zone should be marked as offline.""" self.last_exception = exception self.last_exception_time = utils.utcnow() api_url = self.api_url logging.warning(_("'%(exception)s' error talking to " "zone %(api_url)s") % locals()) max_errors = FLAGS.zone_failures_to_offline self.attempt += 1 if self.attempt >= max_errors: self.is_active = False logging.error( _("No answer from zone %(api_url)s " "after %(max_errors)d " "attempts. Marking inactive.") % locals() )
def log_error(self, exception): """Something went wrong. Check to see if zone should be marked as offline.""" self.last_exception = exception self.last_exception_time = utils.utcnow() api_url = self.api_url logging.warning(_("'%(exception)s' error talking to " "zone %(api_url)s") % locals()) max_errors = FLAGS.zone_failures_to_offline self.attempt += 1 if self.attempt >= max_errors: self.is_active = False logging.error(_("No answer from zone %(api_url)s " "after %(max_errors)d " "attempts. Marking inactive.") % locals())