Exemple #1
0
    def execute(server, argv):
        options, args = parser.parse_args(argv)

        action = get_command(args, default='list')
        argument = get_argument(args, i=2)
        argument2 = get_argument(args, i=3, default=argument)

        if action == 'list' or action == 'ls':
            return list_rcp_tasks(server, options)
        if action == 'create':
            src_path = argument
            dst_path = argument2
            return create_new_task(server, src_path, dst_path, options)
        elif action == 'start':
            return start_task(server, argument, options)
        elif action == 'stop':
            return stop_task(server, argument, options)
        elif action == 'remove' or action == 'rm':
            return remove_task(server, argument)
        elif action == 'clear':
            return clear_tasks(server)
        elif action == 'fetch':
            return fetch_tree_synchronous(server, options, argument)
        else:
            error("Unknown rcp action {a}".format(a=action))
            return USER_ERROR
Exemple #2
0
    def execute(self, server, argv):
        options, args = parser.parse_args(argv)

        action = get_command(args)
        actionarg = get_argument(args)

        if action == 'import':
            return self.import_path(server, options, actionarg)
        else:
            error("Unknown action {}".format(action))
            return USER_ERROR
Exemple #3
0
    def execute(self, server, argv):
        options, args = parser.parse_args(argv)
        if options.lock_dir is not None:
            self.lock_dir = options.lock_dir
        log("Cache dir is {}".format(self.lock_dir))
        action = get_command(args)
        actionarg = get_argument(args)

        if action == 'import':
            return self.import_path(server, options, actionarg)
        return OK
Exemple #4
0
    def execute(server, argv):
        options, args = parser.parse_args(argv)
        action = get_command(args)
        actionarg = get_argument(args)

        if action == 'list' or action == 'ls':
            return list_workflows(server, options)
        elif action == 'start':
            model = actionarg
            if len(args) >= 4:
                path = get_argument(args, i=3)
                return start_workflow(server, options, model, path)
            else:
                ret = OK
                for path in sys.stdin:
                    ret = ret | start_workflow(server, options, model, path.strip())

                return ret
        else:
            error('Unknown workflows action {a}\n'.format(a=action))
            return USER_ERROR
Exemple #5
0
    def execute(server, argv):
        options, args = parser.parse_args(argv)
        action = get_command(args)
        actionarg = get_argument(args)

        if action == 'list' or action == 'ls':
            return list_workflows(server, options)
        elif action == 'start':
            model = actionarg
            if len(args) >= 4:
                path = get_argument(args, i=3)
                return start_workflow(server, options, model, path)
            else:
                ret = OK
                for path in sys.stdin:
                    ret = ret | start_workflow(server, options, model,
                                               path.strip())

                return ret
        else:
            error('Unknown workflows action {a}\n'.format(a=action))
            return USER_ERROR