def main(): """Usage: vds_bootstrap_complete.py [-c vds_config_str] [-v <ver>] [-V] [-g] <random_num> [reboot]""" try: vds_config_str = None #FIXME: these flags are added for near future use installVirtualizationService = True installGlusterService = False opts, args = getopt.getopt(sys.argv[1:], "v:c:Vg") for o, v in opts: if o == "-v": deployUtil.setBootstrapInterfaceVersion(int(v)) if o == "-c": # it should looks like: # 'ssl=true;ksm_nice=5;images=/images/irsd' without white # spaces in it. vds_config_str = v if o == "-V": installVirtualizationService = False if o == "-g": installGlusterService = True logging.debug("installVirtualizationService = '%s', " "installGlusterService = '%s'" % (installVirtualizationService, installGlusterService)) rnum = args[0] except: print main.__doc__ return False try: arg = int(args[1]) except: arg = 1 res = True try: res = deployUtil.instCert(rnum, VDSM_CONF_FILE) if res: res = deployUtil.setCoreDumpPath() if res: res = deployUtil.cleanAll(rnum) if res: try: deployUtil.setVdsConf(vds_config_str, VDSM_CONF_FILE) print "<BSTRAP component='VDS Configuration' status='OK'/>" except Exception, err: res = False print "<BSTRAP component='VDS Configuration' status='FAIL'" \ " message='%s'/>" % deployUtil.escapeXML(str(err)) deployUtil.setService("vdsmd", "reconfigure")
def main(): """Usage: vds_bootstrap_complete.py [-c vds_config_str] [-v] [-g] <random_num> [reboot]""" try: vds_config_str = None #FIXME: these flags are added for near future use installVirtualizationService = False installGlusterService = False opts, args = getopt.getopt(sys.argv[1:], "c:vg") for o,v in opts: if o == "-c": # it should looks like: 'ssl=true;ksm_nice=5;images=/images/irsd' # without white spaces in it. vds_config_str = v if o == "-v": installVirtualizationService = True if o == "-g": installGlusterService = True logging.debug("installVirtualizationService = '%s', installGlusterService = '%s'"%(installVirtualizationService, installGlusterService)) rnum = args[0] except: print main.__doc__ return 0 try: arg = int(args[1]) except: arg = 1 res = True try: res = deployUtil.instCert(rnum, VDSM_CONF_FILE) if res: res = deployUtil.setCoreDumpPath() if res: res = deployUtil.cleanAll(rnum) if res: res = deployUtil.setVdsConf(vds_config_str, VDSM_CONF_FILE) deployUtil.setService("vdsmd", "reconfigure") except: logging.error('bootstrap complete failed', exc_info=True) res = False if res: print "<BSTRAP component='RHEV_INSTALL' status='OK'/>" sys.stdout.flush() Reboot(arg) else: print "<BSTRAP component='RHEV_INSTALL' status='FAIL'/>" sys.stdout.flush()
def main(): """Usage: vds_bootstrap_complete.py [-c vds_config_str] <random_num> [reboot]""" try: vds_config_str = None opts, args = getopt.getopt(sys.argv[1:], "c:") for o,v in opts: if o == "-c": # it should looks like: 'ssl=true;ksm_nice=5;images=/images/irsd' # without white spaces in it. vds_config_str = v rnum = args[0] except: print main.__doc__ return 0 try: arg = args[1] except: arg = 1 res = True try: res = deployUtil.instCert(rnum, VDSM_CONF_FILE) if res: res = deployUtil.setCoreDumpPath() if res: res = deployUtil.cleanAll(rnum) if res: res = deployUtil.setVdsConf(vds_config_str, VDSM_CONF_FILE) deployUtil.setService("vdsmd", "reconfigure") Reboot(arg) except: logging.error('bootstrap complete failed', exc_info=True) res = False if res: print "<BSTRAP component='RHEV_INSTALL' status='OK'/>" else: print "<BSTRAP component='RHEV_INSTALL' status='FAIL'/>" sys.stdout.flush()
def main(): """Usage: vds_bootstrap_complete.py [-c vds_config_str] <random_num> [reboot]""" try: vds_config_str = None opts, args = getopt.getopt(sys.argv[1:], "c:") for o, v in opts: if o == "-c": # it should looks like: 'ssl=true;ksm_nice=5;images=/images/irsd' # without white spaces in it. vds_config_str = v rnum = args[0] except: print main.__doc__ return 0 try: arg = args[1] except: arg = 1 res = True try: res = deployUtil.instCert(rnum, VDSM_CONF_FILE) if res: res = deployUtil.setCoreDumpPath() if res: res = deployUtil.cleanAll(rnum) if res: res = deployUtil.setVdsConf(vds_config_str, VDSM_CONF_FILE) deployUtil.setService("vdsmd", "reconfigure") Reboot(arg) except: logging.error('bootstrap complete failed', exc_info=True) res = False if res: print "<BSTRAP component='RHEV_INSTALL' status='OK'/>" else: print "<BSTRAP component='RHEV_INSTALL' status='FAIL'/>" sys.stdout.flush()