got rid of comments in supervisor, updated edit method in nginx
This commit is contained in:
parent
a3fcded489
commit
257de6483d
2 changed files with 38 additions and 13 deletions
|
|
@ -58,25 +58,54 @@ def restart():
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def edit(location='conf'):
|
def edit(param='help'):
|
||||||
"""
|
"""
|
||||||
calls up mvim on the Nginx conf file
|
calls up mvim on the Nginx conf file
|
||||||
"""
|
"""
|
||||||
|
|
||||||
configuration = env.config
|
configuration = env.config
|
||||||
|
|
||||||
conf_path = os.path.join(
|
config_file_path = os.path.join(
|
||||||
configuration.nginx.sites_available,
|
configuration.nginx.sites_available,
|
||||||
configuration.nginx.conf.name)
|
configuration.nginx.conf.name)
|
||||||
|
|
||||||
if location == 'conf':
|
locations = {
|
||||||
remote_path = conf_path
|
'conf': {
|
||||||
elif location == 'log.error' or location == 'log':
|
'path': config_file_path,
|
||||||
remote_path = configuration.logging.nginx.error
|
'desc': "nginx configuration file",
|
||||||
elif location == 'log.access':
|
},
|
||||||
remote_path = configuration.logging.nginx.access
|
|
||||||
|
|
||||||
maintenance_edit(remote_path=remote_path)
|
'log.error': {
|
||||||
|
'path': configuration.logging.nginx.error,
|
||||||
|
'desc': "nginx error log file",
|
||||||
|
},
|
||||||
|
|
||||||
|
'log.access': {
|
||||||
|
'path': configuration.logging.nxing.access,
|
||||||
|
'desc': "nginx access log file",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if param in locations.keys():
|
||||||
|
remote_path = locations[param]['path']
|
||||||
|
maintenance_edit(remote_path=remote_path)
|
||||||
|
else:
|
||||||
|
# if param == 'help':
|
||||||
|
|
||||||
|
print("""
|
||||||
|
"fab nginx.edit" automates editing files important to nginx 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
|
@task
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,6 @@ def edit(param='help'):
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
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():
|
if param in locations.keys():
|
||||||
remote_path = locations[param]['path']
|
remote_path = locations[param]['path']
|
||||||
maintenance_edit(remote_path=remote_path)
|
maintenance_edit(remote_path=remote_path)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue