loganalyzer.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:sonic-mgmt 作者: Azure 项目源码 文件源码
def check_action(action, log_files_in, out_dir, match_files_in, ignore_files_in, expect_files_in):
    '''
    @summary: This function validates command line parameter 'action' and
        other related parameters.

    @return: True if input is correct
    '''

    ret_code = True

    if (action == 'init'):
        ret_code = True

    elif (action == 'analyze'):
        if out_dir is None or len(out_dir) == 0:
            print 'ERROR: missing required out_dir for analyze action'
            ret_code = False

        elif match_files_in is None or len(match_files_in) == 0:
            print 'ERROR: missing required match_files_in for analyze action'
            ret_code = False


    else:
        ret_code = False
        print 'ERROR: invalid action:%s specified' % action

    return ret_code
#---------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号