Example #1
0
    def build(self):
        # Worker object
        worker = Worker(self.buildconfig)

        # boot
        if self.iso_type == 'boot':
            self.logger.info('Starting the Image Build Process')
            self.imgloc = worker.build_bootiso()

        # DVD
        if self.iso_type == 'dvd':
            self.logger.info('Starting the Image Build Process')
            self.imgloc = worker.build_dvd(self.kickstart)

        #Live image
        if self.iso_type == 'live':
            self.logger.info('Starting the Image Build Process')
            self.imgloc = worker.build_live(self.kickstart)
        
        self.logger.info('Image building process complete')

        #transfer image(s) and logs
        if self.imgloc:
            self.logger.info('Image successfully created. Transferring to staging.')

            t = Transfer(self.buildconfig, self.imgloc, self.logfile)
            status = t.transfer()

            if status == 0:
                self.logger.info('Image(s) and logs available at {0:s}'.format(self.staging))
                #build completion notification email
                self.notify_email_final()
                return 0 

            if status == -1:
                self.logger.info('Error in transfering image(s)/logs')
                dirname, temp = os.path.split(os.path.abspath(self.imgloc[0]))
                self.logger.info('Image(s) available in {0:s} on {1:s}'.format(dirname,os.uname()[1]))
                #build completion notification email
                self.notify_email_final()
                return -1
        else:
            self.logger.info('Error creating image. Transferring Logs.')
            t = Transfer(self.buildconfig, self.imgloc, self.logfile)
            status = t.transfer()

            if status == 0:
                self.logger.info('Logs available at {0:s}'.format(self.staging))
                #build completion notification email
                self.notify_email_final()
                return 0

            if status == -1:
                self.logger.info('Error in transfering logs to staging.')
                #build completion notification email
                self.notify_email_final()
                return -1
Example #2
0
    def build(self):
        
        # Worker object
        worker = Worker(self.build_config)

        # boot
        if self.iso_type == 'boot':
            self.imgloc = worker.build_bootiso()
        # DVD
        if self.iso_type == 'dvd':
            self.imgloc = worker.build_dvd()

        #Live image
        if self.iso_type == 'live':
            self.imgloc = worker.build_live()

        t = Transfer(self.staging, self.imgloc)
        t.transfer_ftp()