示例#1
0
def check_cmd_config():
    '''check whether the commands as given in synctool.conf actually exist'''

    errors = 0

    ok, param.SSH_CMD = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
    if not ok:
        errors += 1

    ok, param.PKG_CMD = config.check_cmd_config('pkg_cmd', param.PKG_CMD)
    if not ok:
        errors += 1

    if errors > 0:
        sys.exit(-1)
示例#2
0
文件: client.py 项目: zenny/synctool
def check_cmd_config():
    # type: () -> None
    '''check whether the commands as given in synctool.conf actually exist'''

    ok, param.DIFF_CMD = config.check_cmd_config('diff_cmd', param.DIFF_CMD)
    if not ok:
        sys.exit(-1)
示例#3
0
def check_cmd_config():
    '''check whether the commands as given in synctool.conf actually exist'''

    errors = 0

    ok, param.SSH_CMD = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
    if not ok:
        errors += 1

    if not OPT_SKIP_RSYNC:
        ok, param.RSYNC_CMD = config.check_cmd_config('rsync_cmd',
                                                      param.RSYNC_CMD)
        if not ok:
            errors += 1

    if errors > 0:
        sys.exit(-1)
示例#4
0
def check_cmd_config():
    '''check whether the commands as given in synctool.conf actually exist'''

    errors = 0

    ok, param.SSH_CMD = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
    if not ok:
        errors += 1

    if not OPT_SKIP_RSYNC:
        ok, param.RSYNC_CMD = config.check_cmd_config('rsync_cmd',
                                                      param.RSYNC_CMD)
        if not ok:
            errors += 1

    if errors > 0:
        sys.exit(-1)
示例#5
0
文件: master.py 项目: zenny/synctool
def check_cmd_config():
    # type: () -> None
    '''check whether the commands as given in synctool.conf actually exist'''

    # pretty lame code
    # Maybe the _CMD params should be a dict?

    errors = 0

    #    ok, param.DIFF_CMD = config.check_cmd_config('diff_cmd', param.DIFF_CMD)
    #    if not ok:
    #        errors += 1

    #    ok, param.PING_CMD = config.check_cmd_config('ping_cmd', param.PING_CMD)
    #    if not ok:
    #        errors += 1

    ok, param.SSH_CMD = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
    if not ok:
        errors += 1

    if not OPT_SKIP_RSYNC:
        ok, param.RSYNC_CMD = config.check_cmd_config('rsync_cmd',
                                                      param.RSYNC_CMD)
        if not ok:
            errors += 1

    ok, param.SYNCTOOL_CMD = config.check_cmd_config('synctool_cmd',
                                                     param.SYNCTOOL_CMD)
    if not ok:
        errors += 1


#    ok, param.PKG_CMD = config.check_cmd_config('pkg_cmd', param.PKG_CMD)
#    if not ok:
#        errors += 1

    if errors > 0:
        sys.exit(1)
示例#6
0
def check_cmd_config():
    # type: () -> None
    '''check whether the commands as given in synctool.conf actually exist'''

    # pretty lame code
    # Maybe the _CMD params should be a dict?

    errors = 0

#    ok, param.DIFF_CMD = config.check_cmd_config('diff_cmd', param.DIFF_CMD)
#    if not ok:
#        errors += 1

#    ok, param.PING_CMD = config.check_cmd_config('ping_cmd', param.PING_CMD)
#    if not ok:
#        errors += 1

    ok, param.SSH_CMD = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
    if not ok:
        errors += 1

    if not OPT_SKIP_RSYNC:
        ok, param.RSYNC_CMD = config.check_cmd_config('rsync_cmd',
                                                      param.RSYNC_CMD)
        if not ok:
            errors += 1

    ok, param.SYNCTOOL_CMD = config.check_cmd_config('synctool_cmd',
                                                     param.SYNCTOOL_CMD)
    if not ok:
        errors += 1

#    ok, param.PKG_CMD = config.check_cmd_config('pkg_cmd', param.PKG_CMD)
#    if not ok:
#        errors += 1

    if errors > 0:
        sys.exit(1)
示例#7
0
def list_commands(cmds):
    # type: (List[str]) -> None
    '''display command setting'''

    for cmd in cmds:
        if cmd == 'diff':
            ok, _ = config.check_cmd_config('diff_cmd', param.DIFF_CMD)
            if ok:
                print param.DIFF_CMD

        if cmd == 'ping':
            ok, _ = config.check_cmd_config('ping_cmd', param.PING_CMD)
            if ok:
                print param.PING_CMD

        elif cmd == 'ssh':
            ok, _ = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
            if ok:
                print param.SSH_CMD

        elif cmd == 'rsync':
            ok, _ = config.check_cmd_config('rsync_cmd', param.RSYNC_CMD)
            if ok:
                print param.RSYNC_CMD

        elif cmd == 'synctool':
            ok, _ = config.check_cmd_config('synctool_cmd', param.SYNCTOOL_CMD)
            if ok:
                print param.SYNCTOOL_CMD

        elif cmd == 'pkg':
            ok, _ = config.check_cmd_config('pkg_cmd', param.PKG_CMD)
            if ok:
                print param.PKG_CMD

        else:
            error("no such command '%s' available in synctool" % cmd)
示例#8
0
def list_commands(cmds):
    # type: (List[str]) -> None
    '''display command setting'''

    for cmd in cmds:
        if cmd == 'diff':
            ok, _ = config.check_cmd_config('diff_cmd', param.DIFF_CMD)
            if ok:
                print param.DIFF_CMD

        if cmd == 'ping':
            ok, _ = config.check_cmd_config('ping_cmd', param.PING_CMD)
            if ok:
                print param.PING_CMD

        elif cmd == 'ssh':
            ok, _ = config.check_cmd_config('ssh_cmd', param.SSH_CMD)
            if ok:
                print param.SSH_CMD

        elif cmd == 'rsync':
            ok, _ = config.check_cmd_config('rsync_cmd', param.RSYNC_CMD)
            if ok:
                print param.RSYNC_CMD

        elif cmd == 'synctool':
            ok, _ = config.check_cmd_config('synctool_cmd', param.SYNCTOOL_CMD)
            if ok:
                print param.SYNCTOOL_CMD

        elif cmd == 'pkg':
            ok, _ = config.check_cmd_config('pkg_cmd', param.PKG_CMD)
            if ok:
                print param.PKG_CMD

        else:
            error("no such command '%s' available in synctool" % cmd)
示例#9
0
def check_cmd_config():
    '''check whether the commands as given in synctool.conf actually exist'''

    ok, param.RSYNC_CMD = config.check_cmd_config('rsync_cmd', param.RSYNC_CMD)
    if not ok:
        sys.exit(-1)
示例#10
0
def check_cmd_config():
    '''check whether the commands as given in synctool.conf actually exist'''

    ok, param.PING_CMD = config.check_cmd_config('ping_cmd', param.PING_CMD)
    if not ok:
        sys.exit(-1)