Example #1
0
def cli_run(args):
    try:
        argdict = args.__dict__
        destination = argdict['destination']
        nm = NuleculeManager(app_spec=argdict['app_spec'],
                             destination=destination,
                             cli_answers=argdict['cli_answers'],
                             answers_file=argdict['answers'])
        nm.run(**argdict)
        # Clean up the files if the user asked us to. Otherwise
        # notify the user where they can manage the application
        if destination and destination.lower() == 'none':
            Utils.rm_dir(nm.app_path)
        else:
            print_app_location(nm.app_path)
        sys.exit(0)
    except DockerException as e:
        logger.error(e)
        sys.exit(1)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #2
0
def cli_genanswers(args):
    argdict = args.__dict__
    nm = NuleculeManager(app_spec=argdict['app_spec'],
                         destination='none')
    nm.genanswers(**argdict)
    Utils.rm_dir(nm.app_path)  # clean up files
    sys.exit(0)
Example #3
0
def cli_genanswers(args):
    argdict = args.__dict__
    nm = NuleculeManager(app_spec=argdict['app_spec'],
                         destination='none')
    nm.genanswers(**argdict)
    Utils.rm_dir(nm.app_path)  # clean up files
    sys.exit(0)
Example #4
0
def cli_run(args):
    try:
        argdict = args.__dict__
        destination = argdict['destination']
        nm = NuleculeManager(app_spec=argdict['app_spec'],
                             destination=destination,
                             cli_answers=argdict['cli_answers'],
                             answers_file=argdict['answers'])
        nm.run(**argdict)
        # Clean up the files if the user asked us to. Otherwise
        # notify the user where they can manage the application
        if destination and destination.lower() == 'none':
            Utils.rm_dir(nm.app_path)
        else:
            print_app_location(nm.app_path)
        sys.exit(0)
    except DockerException as e:
        logger.error(e)
        sys.exit(1)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #5
0
def cli_stop(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'])
        nm.stop(**argdict)
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #6
0
def cli_stop(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'])
        nm.stop(**argdict)
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #7
0
def cli_genanswers(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'], destination='none')
        nm.genanswers(**argdict)
        Utils.rm_dir(nm.app_path)  # clean up files
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #8
0
def cli_genanswers(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'],
                             destination='none')
        nm.genanswers(**argdict)
        Utils.rm_dir(nm.app_path)  # clean up files
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #9
0
def cli_run(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'],
                             destination=argdict['destination'])
        nm.run(**argdict)
        print_app_location(nm.app_path)
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #10
0
def cli_fetch(args):
    argdict = args.__dict__
    destination = argdict['destination']
    nm = NuleculeManager(app_spec=argdict['app_spec'],
                         destination=destination,
                         cli_answers=argdict['cli_answers'],
                         answers_file=argdict['answers'])
    nm.fetch(**argdict)
    # Clean up the files if the user asked us to. Otherwise
    # notify the user where they can manage the application
    if destination and destination.lower() == 'none':
        Utils.rm_dir(nm.app_path)
    else:
        print_app_location(nm.app_path)
    sys.exit(0)
Example #11
0
def cli_install(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(
            app_spec=argdict["app_spec"], destination=argdict["destination"], answers_file=argdict["answers"]
        )
        nm.install(**argdict)
        print_app_location(nm.app_path)
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #12
0
def cli_fetch(args):
    argdict = args.__dict__
    destination = argdict['destination']
    nm = NuleculeManager(app_spec=argdict['app_spec'],
                         destination=destination,
                         cli_answers=argdict['cli_answers'],
                         answers_file=argdict['answers'])
    nm.fetch(**argdict)
    # Clean up the files if the user asked us to. Otherwise
    # notify the user where they can manage the application
    if destination and destination.lower() == 'none':
        Utils.rm_dir(nm.app_path)
    else:
        print_app_location(nm.app_path)
    sys.exit(0)
Example #13
0
def cli_run(args):
    try:
        argdict = args.__dict__
        nm = NuleculeManager(app_spec=argdict['app_spec'],
                             destination=argdict['destination'],
                             answers_file=argdict['answers'])
        nm.run(**argdict)
        print_app_location(nm.app_path)
        sys.exit(0)
    except NuleculeException as e:
        logger.error(e)
        sys.exit(1)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #14
0
def cli_init(args):
    try:
        argdict = args.__dict__
        appdir = NuleculeManager.init(argdict['app_name'],
                                      argdict['destination'])
        if appdir:
            print('\nAtomic App: %s initialized at %s' %
                  (argdict['app_name'], appdir))
        sys.exit(0)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #15
0
def cli_init(args):
    try:
        argdict = args.__dict__
        appdir = NuleculeManager.init(argdict['app_name'],
                                      argdict['destination'])
        if appdir:
            print('\nAtomic App: %s initialized at %s' %
                  (argdict['app_name'], appdir))
        sys.exit(0)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #16
0
def cli_init(args):
    try:
        argdict = args.__dict__
        created, destination = NuleculeManager.init(argdict['app_name'], argdict['destination'])
        if created:
            print('\nAtomic App: %s initialized at %s' % (argdict['app_name'], destination))
        else:
            print(
                '\nAtomic App: %s was not initialized because destination directory: %s is not empty.' % (
                    argdict['app_name'], destination)
            )
        sys.exit(0)
    except Exception as e:
        logger.error(e, exc_info=True)
        sys.exit(1)
Example #17
0
def cli_stop(args):
    argdict = args.__dict__
    nm = NuleculeManager(app_spec=argdict['app_spec'])
    nm.stop(**argdict)
    sys.exit(0)
Example #18
0
def cli_stop(args):
    argdict = args.__dict__
    nm = NuleculeManager(app_spec=argdict['app_spec'])
    nm.stop(**argdict)
    sys.exit(0)