Esempio n. 1
0
def run_as_utility():
    register_all()
    import sys
    if "create_base" in sys.argv:
        create_base()
    elif "setup_brand" in sys.argv:
        brand_identifier = sys.argv[sys.argv.index('setup_brand') + 1]
        setup_brand(brand_identifier)
    else:
        print >>sys.stderr, "I don't know what you want me to do!"

    print >>sys.stderr, "IF YOU HAVE CREATED NEW KEYS, BACK THEM UP NOW!"    
Esempio n. 2
0
def run_as_utility():
    register_all()
    import sys
    if "create_base" in sys.argv:
        create_base()
    elif "setup_brand" in sys.argv:
        brand_identifier = sys.argv[sys.argv.index('setup_brand') + 1]
        setup_brand(brand_identifier)
    else:
        print >> sys.stderr, "I don't know what you want me to do!"

    print >> sys.stderr, "IF YOU HAVE CREATED NEW KEYS, BACK THEM UP NOW!"
Esempio n. 3
0
    else:
        logging.root.setLevel(logging.INFO)


def setup_application():
    config = get_config()
    if config is not None:
        return
    config = read_config_file()
    validate_config(config)
    set_config(config)


setup_logging()
setup_application()
serial.register_all()


@read_querydata
def get_layers(environ, start_response):
    log = logging.getLogger("get_layers")

    log.debug("start")
    try:
        brand_identifier = environ['query_data']['brand_id'][0]
    except KeyError:
        log.error("Got bad request.")
        return BadRequest()(environ, start_response)

    try:
        layer_data = server.get_escrow_layers(brand_identifier)
Esempio n. 4
0
    logging.root.addHandler(handler)

    if 'SPIDEROAK_NETKES_LOG_DEBUG' in os.environ:
        logging.root.setLevel(logging.DEBUG)
        logging.info("Debug logging enabled. Warning, lots of output!")
    else:
        logging.root.setLevel(logging.INFO)

def setup_application():
    config = read_config_file()
    validate_config(config)


setup_logging()
setup_application()
serial.register_all()

@read_querydata
def get_layers(environ, start_response):
    log = logging.getLogger("get_layers")

    log.debug("start")
    try:
        brand_identifier = environ['query_data']['brand_id'][0]
    except KeyError:
        log.error("Got bad request.")
        return BadRequest()(environ, start_response)

    try:
        layer_data = server.get_escrow_layers(brand_identifier)
    except (KeyError, IOError,):