"""
def __init__(self, name, os_type, os_version, status=None, user='ubuntu'):
self.name = name
+ self.shortname = decanonicalize_hostname(self.name)
self.os_type = os_type
self.os_version = os_version
self.status = status or query.get_status(self.name)
raise ValueError("I need a config_path!")
if not self.user_path:
raise ValueError("I need a user_path!")
- shortname = decanonicalize_hostname(self.name)
args = [
self.executable,
'--wait',
'--meta-data=%s' % self.config_path,
'--user-data=%s' % self.user_path,
- shortname,
+ self.shortname,
]
log.info("Provisioning a {distro} {distroversion} vps".format(
distro=self.os_type,
if not executable:
log.error("No downburst executable found.")
return False
- shortname = decanonicalize_hostname(self.name)
- args = [executable, '-c', self.host, 'destroy', shortname]
+ args = [executable, '-c', self.host, 'destroy', self.shortname]
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE,)
out, err = proc.communicate()
if err:
+ not_found_msg = "no domain with matching name '%s'" % self.shortname
+ if not_found_msg in err:
+ log.warn("Ignoring error during destroy: %s", err)
+ return True
log.error("Error destroying {machine}: {msg}".format(
machine=self.name, msg=err))
return False
except (subprocess.CalledProcessError, OSError):
log.exception("Error calling downburst!")
log.info('Using default values for supported os_type/os_version')
- return default_table
\ No newline at end of file
+ return default_table