Example #1
0
def daemon():
    args = parse_args(sys.argv[1:])
    config = get_config("slave.yaml", path=args.config)

    auth_method = get_auth_method(args, config)
    proxy = get_proxy(config, auth_method)

    from debile.slave.daemon import main
    main(args, config, proxy)
Example #2
0
def main():
    args = list(sys.argv[1:])
    command = args.pop(0)
    try:
        run = COMMANDS[command]
    except KeyError:
        return _help()

    config = get_config("user.yaml")
    proxy = get_proxy(config, config.get('auth_method', 'ssl'))

    return run(proxy, *args)
Example #3
0
File: cli.py Project: Debian/debile
def main():
    args = list(sys.argv[1:])
    command = args.pop(0)
    try:
        run = COMMANDS[command]
    except KeyError:
        return _help()

    config = get_config("user.yaml")
    proxy = get_proxy(config)

    return run(proxy, *args)
Example #4
0
def daemon():
    from argparse import ArgumentParser
    parser = ArgumentParser(description="Debile build slave")
    parser.add_argument("--config", action="store", dest="config", default=None,
                        help="Path to the slave.yaml config file.")
    parser.add_argument("-s", "--syslog", action="store_true", dest="syslog",
                        help="Log to syslog instead of stderr.")
    parser.add_argument("-d", "--debug", action="store_true", dest="debug",
                        help="Enable debug messages to stderr.")

    args = parser.parse_args()
    config = get_config("slave.yaml", path=args.config)
    proxy = get_proxy(config)

    from debile.slave.daemon import main
    main(args, config, proxy)
Example #5
0
def main():
    args = list(sys.argv[1:])
    command = args.pop(0)
    try:
        run = COMMANDS[command]
    except KeyError:
        return _help()

    config = get_config("user.yaml")
    xml = config.get('xmlrpc')
    auth_method = 'ssl'
    if xml is not None:
        auth_method = xml.get('auth_method', 'ssl')

    proxy = get_proxy(config, auth_method)

    return run(proxy, *args)
Example #6
0
def main():
    args = list(sys.argv[1:])
    command = args.pop(0)
    try:
        run = COMMANDS[command]
    except KeyError:
        return _help()

    config = get_config("user.yaml")
    xml = config.get('xmlrpc')
    auth_method = 'ssl'
    if xml is not None:
        auth_method = xml.get('auth_method', 'ssl')

    proxy = get_proxy(config, auth_method)

    return run(proxy, *args)
Example #7
0
def daemon():
    from argparse import ArgumentParser
    parser = ArgumentParser(description="Debile build slave")
    parser.add_argument("--config", action="store", dest="config", default=None,
                        help="Path to the slave.yaml config file.")
    parser.add_argument("-s", "--syslog", action="store_true", dest="syslog",
                        help="Log to syslog instead of stderr.")
    parser.add_argument("-d", "--debug", action="store_true", dest="debug",
                        help="Enable debug messages to stderr.")
    parser.add_argument("--auth", action="store", dest="auth_method",
                        default='ssl',
                        help="Authentication method ('ssl' or 'simple')")

    args = parser.parse_args()
    config = get_config("slave.yaml", path=args.config)
    proxy = get_proxy(config, args.auth_method)

    from debile.slave.daemon import main
    main(args, config, proxy)
Example #8
0
def _init_config(path):
    config.update(get_config(name="master.yaml", path=path))
    return config
Example #9
0
    def test_get_config_passing_path(self):
        file_content = config_utils.get_config('config.yaml', self.config)

        self.assertEqual(file_content['A'], 'a')
Example #10
0
    def test_get_config(self):
        file_content = config_utils.get_config('config.yaml')

        self.assertEqual(file_content['A'], 'a')
Example #11
0
    def test_get_config_passing_path(self):
        file_content = config_utils.get_config('config.yaml', self.config)

        self.assertEqual(file_content['A'], 'a')
Example #12
0
    def test_get_config(self):
        file_content = config_utils.get_config('config.yaml')

        self.assertEqual(file_content['A'], 'a')
Example #13
0
def _init_config(path):
    config.update(get_config(name="master.yaml", path=path))
    return config