()
| 290 | conf_data[expansion_item] = os.path.expanduser(conf_data[expansion_item]) |
| 291 | |
| 292 | def create_default_conf(): |
| 293 | fpath = gdata['conf_path'] |
| 294 | if not os.path.isfile(fpath): |
| 295 | default_conf = get_default_conf() |
| 296 | mkdir_p(os.path.dirname(fpath)) |
| 297 | d = json_to_dict(default_conf) |
| 298 | zkroot = os.path.expanduser(d["zkroot"]) |
| 299 | mkdir_p(zkroot) |
| 300 | seldon_models = os.path.expanduser(d["seldon_models"]) |
| 301 | mkdir_p(seldon_models) |
| 302 | default_conf = json.dumps(d, sort_keys=True, indent=4, separators=(',', ': ')) |
| 303 | f = open(fpath, 'w') |
| 304 | f.write(default_conf) |
| 305 | f.write('\n') |
| 306 | f.close() |
| 307 | print "Created conf file [{fpath}] with default settings.".format(**locals()) |
| 308 | sys.exit(0) |
| 309 | else: |
| 310 | print "Existing conf file [{fpath}] found.".format(**locals()) |
| 311 | |
| 312 | def check_conf(): |
| 313 | fpath = gdata['conf_path'] |
no test coverage detected