def deploy(force=False): """ Deploys the system. If "force" is False (default) then deployment will only be done on a supported system. """ # download() print "version_info", sys.version_info print "sys.prefix", sys.prefix if is_ubuntu(): ubuntu() elif is_centos(): centos() elif is_osx(): osx() elif force: print "WARNING: Installation on an unsupported system detected." print " Proceeding at your own risk." install() else: print "ERROR: OS distribution not supported (use --force)" print " please see documatation for manual" print " installation instructions." sys.exit()
def deploy(): """deploys the system on supported distributions""" # download() print "version_info", sys.version_info print "sys.prefix", sys.prefix if is_ubuntu(): ubuntu() elif is_centos(): centos() elif is_osx(): osx() else: print "ERROR: OS distribution not supported" print " please see documatation for manual" print " installation instructions." sys.exit()
def install_command(args): """ Usage: install -h | --help install --version install cloudmesh [--force] install delete_yaml install system install query install new [--force] install vagrant install enable admin [--username=<username>] """ # This is a debuging message # print "IIIII<" + args + ">" arguments = docopt(install_command.__doc__, args) # print arguments if arguments["cloudmesh"]: force = arguments['--force'] deploy(force=force) elif arguments["new"]: force = arguments["--force"] new_cloudmesh_yaml(force) elif arguments["delete_yaml"]: answer = yn_choice( "THIS COMMAND IS REAL DANGEROUS AND WILL DELETE ALL YOUR YAML FILE. Proceed", default='y') if answer: # TODO: cp is not imported, defined print("You fool we just deleted your yaml files") cp("etc/*.yaml", config_file_prefix()) else: print "puuh you interrupted" pass elif arguments["system"]: banner("Installing Ubuntu System Requirements") if is_ubuntu(): ubuntu() elif is_osx(): osx() elif is_centos(): centos() elif arguments["query"]: import platform print "System: ", platform.system() # print "Uname: ", platform.uname() print "Machine: ", platform.machine() print "Processor: ", platform.processor() print "Platform: ", platform.platform() print "Python: ", platform.python_version() print "Virtualenv:", hasattr(sys, 'real_prefix') elif arguments["vagrant"]: vagrant() elif arguments["enable"] and arguments["admin"]: enable_admin_page(arguments['--username'])