Validate the beacon configuration

def validate(config):
    '''
    Validate the beacon configuration
    '''
    # Configuration for pkg beacon should be a list
    if not isinstance(config, list):
        return False, ('Configuration for pkg beacon must be a list.')

    # Configuration for pkg beacon should contain pkgs
    pkgs_found = False
    pkgs_not_list = False
    for config_item in config:
        if 'pkgs' in config_item:
            pkgs_found = True
            if isinstance(config_item['pkgs'], list):
                pkgs_not_list = True

    if not pkgs_found or not pkgs_not_list:
        return False, 'Configuration for pkg beacon requires list of pkgs.'
    return True, 'Valid beacon configuration'