elif opt == "--dest": dest_url = val if init_network: configureNetworking(answer_device, answer_config) # probe for XS installations insts = product.findXenSourceProducts() if len(insts) == 0: xcp.logger.log("No installations found.") return if not dest_url: xcp.logger.log("Destination directory not specified.") return for inst in insts: xcp.logger.log(str(inst)) bugtool(inst, dest_url) return reboot if __name__ == "__main__": f = open('/proc/cmdline') args = map(lambda x: '--'+x, f.readline().strip().split()) f.close() reboot = main(util.splitArgs(args)) if reboot: os.system("reboot")
media, address = rc repos = answers['repos'] # now load the drivers: for r in repos: logger.log("Processing repo %s" % r) try: r.installPackages(lambda x: (), {'root': '/'}) answers['driver-repos'].append(str(r)) ButtonChoiceWindow(ui.screen, "Drivers Loaded", "Loaded %s." % r.name(), ['Ok']) except Exception as e: logger.logException(e) ButtonChoiceWindow( ui.screen, "Problem Loading Driver", "Setup was unable to load the device driver.", ['Ok']) return media, address def main(args): if len(doInteractiveLoadDriver(tui, {})) > 0: return 0 else: return 1 if __name__ == "__main__": sys.exit(main(util.splitArgs(sys.argv[1:])))
# exit with failure status: status = constants.EXIT_ERROR else: # run the user's scripts - an arg of "0" indicates success try: scripts.run_scripts('installation-complete', '0') except: pass # put the log in /tmp: xelogging.collectLogs('/tmp') # and now on the disk if possible: if 'primary-disk' in results and 'primary-partnum' in results and 'logs-partnum' in results: backend.writeLog(results['primary-disk'], results['primary-partnum'], results['logs-partnum']) elif 'primary-disk' in results and 'primary-partnum' in results: backend.writeLog(results['primary-disk'], results['primary-partnum'], None) assert (status == constants.EXIT_OK or status == constants.EXIT_USER_CANCEL) return status if __name__ == "__main__": sys.exit(main(util.splitArgs(sys.argv[1:], array_args=('--extrarepo'))))
elif opt == "--dest": dest_url = val if init_network: configureNetworking(answer_device, answer_config) # probe for XS installations insts = product.findXenSourceProducts() if len(insts) == 0: xcp.logger.log("No XenServer installations found.") return if not dest_url: xcp.logger.log("Destination directory not specified.") return for inst in insts: xcp.logger.log(str(inst)) bugtool(inst, dest_url) return reboot if __name__ == "__main__": f = open('/proc/cmdline') args = map(lambda x: '--'+x, f.readline().strip().split()) f.close() reboot = main(util.splitArgs(args)) if reboot: os.system("reboot")
backend.writeLog(results['primary-disk'], results['primary-partnum']) xelogging.log(results) except Exception, e: # Don't let logging exceptions prevent subsequent actions print 'Logging failed: '+str(e) # exit with failure status: status = constants.EXIT_ERROR else: # run the user's scripts - an arg of "0" indicates success try: scripts.run_scripts('installation-complete', '0') except: pass # put the log in /tmp: xelogging.collectLogs('/tmp') # and now on the disk if possible: if 'primary-disk' in results and 'primary-partnum' in results: backend.writeLog(results['primary-disk'], results['primary-partnum']) assert (status == constants.EXIT_OK or status == constants.EXIT_USER_CANCEL) return status if __name__ == "__main__": sys.exit(main(util.splitArgs(sys.argv[1:], array_args = ('--extrarepo'))))
ui.screen, "No Compatible Drivers", "Setup was unable to find any drivers compatible with this version of %s." % (PRODUCT_BRAND or PLATFORM_NAME), ['Ok'] ) elif len(loaded_drivers) > 0: answers['loaded-drivers'] += loaded_drivers answers['driver-repos'] += map(lambda r: str(r), required_repo_list) text = "The following drivers were successfully loaded:\n\n" for dr in loaded_drivers: text += " * %s\n" % dr ButtonChoiceWindow( ui.screen, "Drivers Loaded", text, ['Ok']) return media, address, required_repo_list def main(args): if len(doInteractiveLoadDriver(tui, {})) > 0: return 0 else: return 1 if __name__ == "__main__": sys.exit(main(util.splitArgs(sys.argv[1:])))