notifly/server.py
def parse_config_file(config):
    """
    Load config file (primarily for endpoints)
    """
    fail = False
    with open(config, 'r') as fp:
        content = yaml.load(fp.read())
    if 'endpoints' not in content.keys():
        return
    for title, items in content['endpoints'].items():
        if not 'url' in items.keys():
            fail = True
            logging.error("no url found in endpoint '%s'", title)
        if not items['url'].startswith('http'):
            fail = True
            logging.error("non HTTP(S) url found in endoint '%s'", title)
        if not items['url'].startswith('https'):
            logging.warning("non SSL url found in endoint '%s'", title)
    if fail:
        logging.info("stopping execution due to blocking config issues")
        sys.exit(1)
    return content

    Load config file (primarily for endpoints)
    
Load config file (primarily for endpoints)
Load config file ( primarily for endpoints )
def parse_config_file(config):
    fail = False
    with open(config, 'r') as fp:
        content = yaml.load(fp.read())
    if 'endpoints' not in content.keys():
        return
    for title, items in content['endpoints'].items():
        if not 'url' in items.keys():
            fail = True
            logging.error("no url found in endpoint '%s'", title)
        if not items['url'].startswith('http'):
            fail = True
            logging.error("non HTTP(S) url found in endoint '%s'", title)
        if not items['url'].startswith('https'):
            logging.warning("non SSL url found in endoint '%s'", title)
    if fail:
        logging.info("stopping execution due to blocking config issues")
        sys.exit(1)
    return content
def parse_config_file ( config ) : fail = False with open ( config , 'r' ) as fp : content = yaml . load ( fp . read ( ) ) if 'endpoints' not in content . keys ( ) : return for title , items in content [ 'endpoints' ] . items ( ) : if not 'url' in items . keys ( ) : fail = True logging . error ( "no url found in endpoint '%s'" , title ) if not items [ 'url' ] . startswith ( 'http' ) : fail = True logging . error ( "non HTTP(S) url found in endoint '%s'" , title ) if not items [ 'url' ] . startswith ( 'https' ) : logging . warning ( "non SSL url found in endoint '%s'" , title ) if fail : logging . info ( "stopping execution due to blocking config issues" ) sys . exit ( 1 ) return content
Load config file (primarily for endpoints)
Load config file ( primarily for endpoints )
"""
    Load config file (primarily for endpoints)
    """
config