MCPcopy Create free account
hub / github.com/SeldonIO/seldon-server / create_default_conf

Function create_default_conf

python/seldon/shell/shell_main.py:306–321  ·  view source on GitHub ↗
(fpath)

Source from the content-addressed store, hash-verified

304
305def 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)

Callers 1

check_confFunction · 0.70

Calls 4

get_default_confFunction · 0.70
mkdir_pFunction · 0.70
json_to_dictFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected