Example #1
0
def vacate_tmplease(p, c, vm_name):
    
    try:
        tmplease.teardown(p, c, vm_name)
        c.log.debug("removed tmplease, if any")
    except:
        exception_type = sys.exc_type
        try:
            exceptname = exception_type.__name__ 
        except AttributeError:
            exceptname = exception_type
        errstr = "Possible issue with tmpplease teardown: %s: %s" % (str(exceptname), str(sys.exc_value))
        c.log.error(errstr)
Example #2
0
def _common_withnetsecurity(vm_name, nic_set, kernel, local_file_set, p, c, netsecurity, platform, justprint):
    
    if c.trace:
        c.log.debug("_common_withnetsecurity()")
    
    local_file_set = tmplease.setup(p, c, local_file_set, vm_name)
    try:
        _common_withtmplease(nic_set, kernel, local_file_set, c, netsecurity, platform, justprint)
    except Exception,e:
        c.log.exception(e)
        try:
            c.log.error("Creation problem: going to back out tmp space lease")
            tmplease.teardown(p, c, vm_name)
            c.log.error("Backed out tmp space lease")
        except Exception,e2:
            c.log.exception(e2)