Alex Savatieiev | c905571 | 2019-03-01 14:43:56 -0600 | [diff] [blame] | 1 | import os |
2 | |||||
3 | from cfg_checker.common.exception import ConfigException | ||||
4 | |||||
5 | |||||
6 | def get_file_arg(args): | ||||
7 | if args.file: | ||||
8 | return args.file | ||||
9 | else: | ||||
10 | raise ConfigException("No report filename supplied") | ||||
11 | |||||
12 | |||||
13 | def get_path_arg(path): | ||||
14 | if os.path.exists(path): | ||||
15 | return path | ||||
16 | else: | ||||
17 | raise ConfigException("'{}' not exists".format(path)) |