Beispiel #1
0
    def generateIsoAnswerfile(self):
        autoyastfile = "autoyast-%s.cfg" % (self.parent._osParent_name)
        filename = "%s/%s" % (xenrt.TEC().getLogdir(), autoyastfile)
        xenrt.TEC().logverbose("FILENAME %s"%filename)
        self.nfsdir = xenrt.NFSDirectory()  
        ayf= SLESAutoyastFile(self.distro,
                             self.nfsdir.getMountURL(""),
                             self._maindisk,
                             installOn=self.parent._osParent_hypervisorType,
                             pxe=False)
#                             rebootAfterInstall = False)

        ay = ayf.generate()
        f = file(filename, "w")
        f.write(ay)
        f.close()

        installIP = self.getIP(trafficType="OUTBOUND", timeout=600)
        path = "%s/%s" % (xenrt.TEC().lookup("GUESTFILE_BASE_PATH"), installIP)
        
        self.cleanupdir = path
        try:
            os.makedirs(path)
        except:
            pass
        xenrt.rootops.sudo("chmod -R a+w %s" % path)
        xenrt.command("rm -f %s/autoyast.stamp" % path)
        shutil.copyfile(filename, "%s/autoyast" % (path))
Beispiel #2
0
    def generateAnswerfile(self, webdir):
        """Generate an answerfile and put it in the provided webdir, returning any command line arguments needed to boot the OS"""
        autoyastfile = "autoyast-%s.cfg" % (self.parent._osParent_name)
        filename = "%s/%s" % (xenrt.TEC().getLogdir(), autoyastfile)
        xenrt.TEC().logverbose("FILENAME %s"%filename)
        
        self.nfsdir = xenrt.NFSDirectory()  
        ayf= SLESAutoyastFile(self.distro,
                             self.nfsdir.getMountURL(""),
                             self._maindisk,
                             installOn=self.parent._osParent_hypervisorType,
                             pxe=False)
#                             rebootAfterInstall = False)

        ay = ayf.generate()
        f = file(filename, "w")
        f.write(ay)
        f.close()

        webdir.copyIn(filename)
        url = webdir.getURL(os.path.basename(filename))

        # TODO: handle native where console is different, and handle other interfaces
        return ["graphical", "utf8", "ks=%s" % url]