def test_get_proxy_simple_auth(self): data = dict(xmlrpc=dict(host='localhost', port='22017')) proxy = get_proxy(data, 'simple') self.assertEquals(proxy.__dict__['_ServerProxy__host'], 'localhost:22017') self.assertTrue(proxy.__dict__['_ServerProxy__allow_none'])
def test_get_proxy_simple_auth(self): data = dict(xmlrpc = dict(host='localhost', port='22017')) proxy = get_proxy(data, 'simple') self.assertEquals(proxy.__dict__['_ServerProxy__host'], 'localhost:22017') self.assertTrue(proxy.__dict__['_ServerProxy__allow_none'])
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)
def test_get_proxy_ssl_auth(self): data = dict(xmlrpc = dict(host='localhost', port='22017', keyfile='~/keyfile.key', certfile='~/certfile.crt')) proxy = get_proxy(data, 'ssl') self.assertEquals(proxy.__dict__['_ServerProxy__host'], 'localhost:22017') self.assertTrue(proxy.__dict__['_ServerProxy__allow_none']) self.assertIsInstance(proxy.__dict__['_ServerProxy__transport'], DebileSafeTransport)
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)
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)
def test_get_proxy_ssl_auth(self): data = dict(xmlrpc=dict(host='localhost', port='22017', keyfile='~/keyfile.key', certfile='~/certfile.crt')) proxy = get_proxy(data, 'ssl') self.assertEquals(proxy.__dict__['_ServerProxy__host'], 'localhost:22017') self.assertTrue(proxy.__dict__['_ServerProxy__allow_none']) self.assertIsInstance(proxy.__dict__['_ServerProxy__transport'], DebileSafeTransport)
def _create_slave(name, password, key): "Create a slave - debile-remote create-slave name password key" proxy = get_proxy(config) try: key = open(key, 'r').read() except IOError as e: print("Error whilst opening OpenPGP public key.") print(" %s when trying to open %s" % (str(e), key)) return -1 print proxy.create_builder(name, password, key)
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)
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)
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)
from debile.slave.utils import tdir, cd, upload from debile.utils.xmlrpc import get_proxy from debile.utils.aget import aget from debile.utils.bget import bget from debile.utils.dud import Dud_ from dput.exceptions import DputError, DcutError from firehose.model import (Analysis, Generator, Metadata, DebianBinary, DebianSource) import logging from logging.handlers import SysLogHandler import glob import time proxy = get_proxy(config) class IDidNothingError(Exception): pass def listize(entry): items = [x.strip() for x in entry.split(",")] return [None if x == "null" else x for x in items] def generate_sut_from_source(package): name = package['name'] version = package['version'] local = None