(fpath)
| 304 | |
| 305 | def check_conf(): |
| 306 | def create_default_conf(fpath): |
| 307 | default_conf = get_default_conf() |
| 308 | mkdir_p(os.path.dirname(fpath)) |
| 309 | d = json_to_dict(default_conf) |
| 310 | zkroot = os.path.expanduser(d["zkroot"]) |
| 311 | mkdir_p(zkroot) |
| 312 | seldon_models = os.path.expanduser(d["seldon_models"]) |
| 313 | mkdir_p(seldon_models) |
| 314 | default_conf = json.dumps(d, sort_keys=True, indent=4, separators=(',', ': ')) |
| 315 | f = open(fpath, 'w') |
| 316 | f.write(default_conf) |
| 317 | f.write('\n') |
| 318 | f.close() |
| 319 | print "Created conf file [{fpath}] with default settings.".format(**locals()) |
| 320 | print "Edit this file and re-run." |
| 321 | sys.exit(0) |
| 322 | fpath = gdata['conf_path'] |
| 323 | if not os.path.isfile(fpath): |
| 324 | create_default_conf(fpath) |
no test coverage detected