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

Function create_default_conf

python/seldon/cli/cli_main.py:292–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

290 conf_data[expansion_item] = os.path.expanduser(conf_data[expansion_item])
291
292def 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
312def check_conf():
313 fpath = gdata['conf_path']

Callers 1

mainFunction · 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