def _get_scratchdir(self): scratch = None if not self.is_session_uri(): scratch = self._get_system_scratchdir() if (not scratch or not os.path.exists(scratch) or not os.access(scratch, os.W_OK)): scratch = os.path.expanduser("~/.virtinst/boot") if not os.path.exists(scratch): os.makedirs(scratch, 0751) _util.selinux_restorecon(scratch) return scratch
def _get_scratchdir(typ): scratch = None if platform.system() == 'SunOS': scratch = '/var/tmp' if os.geteuid() == 0: if typ == "xen" and os.path.exists(XEN_SCRATCH): scratch = XEN_SCRATCH elif os.path.exists(LIBVIRT_SCRATCH): scratch = LIBVIRT_SCRATCH if not scratch: scratch = os.path.expanduser("~/.virtinst/boot") if not os.path.exists(scratch): os.makedirs(scratch, 0751) _util.selinux_restorecon(scratch) return scratch