Beispiel #1
0
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()
Beispiel #2
0
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()
Beispiel #3
0
def install_package(package):
    """installes the package.
    :param package: lthe package name
    """

    if is_ubuntu():
        local("sudo apt-get -y install {0}".format(package))
    if is_centos():
        local("sudo yum -y install {0}".format(package))
    elif sys.platform == "darwin":
        print "Not yet supported"
        sys.exit()
    elif sys.platform == "win32":
        print "Windows is not supported"
        print "Use Linux instead"
        sys.exit()
Beispiel #4
0
def install_package(package):
    """installes the package.
    :param package: lthe package name
    """

    if is_ubuntu():
        local("sudo apt-get -y install {0}".format(package))
    if is_centos():
        local("sudo yum -y install {0}".format(package))
    elif sys.platform == "darwin":
        print "Not yet supported"
        sys.exit()
    elif sys.platform == "win32":
        print "Windows is not supported"
        print "Use Linux instead"
        sys.exit()
Beispiel #5
0
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()
Beispiel #6
0
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()
Beispiel #7
0
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'])
Beispiel #8
0
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'])