add logs to edit

This commit is contained in:
Ronny Abraham 2018-10-25 20:37:36 +03:00
parent ebb0e6fdbe
commit a3fcded489

View file

@ -108,24 +108,60 @@ def restart():
@task
def edit():
def edit(param='help'):
"""
calls up mvim on the Supervisor conf file
"""
configuration = env.config
param = _initialize(configuration)
if env.debug:
logger = loggify('supervisor', 'edit')
logger.debug()
conf_path = param['conf_path']
configuration_path = _initialize(configuration)['conf_path']
if env.debug:
logger.debug("conf path : %s" % conf_path)
locations = {
'configuration': {
'path': configuration_path,
'desc': "supervisor configuration path",
},
'log.out': {
'path': configuration.logging.supervisor.out,
'desc': "out logging file",
},
'log.err': {
'path': configuration.logging.supervisor.err,
'desc': "err logging file",
},
}
print("\n\n\nlocations: %s\n\n\n" % locations)
print("\n\n\nlocations.keys: %s\n\n\n" % locations.keys())
print("\n\n\nparam: %s\n\n\n" % param)
if param in locations.keys():
remote_path = locations[param]['path']
maintenance_edit(remote_path=remote_path)
else:
maintenance_edit(remote_path=conf_path)
# if param == 'help':
print("""
"fab django.edit" automates editing files important to django whether
locally or remotely
to use this you must pass one of the editable locations in as a
parameter
currently editable locations are:
""")
for k_loc in locations.keys():
print("\t{0: <20} - {1}".format(k_loc, locations[k_loc]['desc']))
return
@task