add backup to nginx.edit optiosn

This commit is contained in:
Ronny Abraham 2019-06-27 19:31:31 +03:00
parent 4c413005c1
commit 43fd9e4cd7

View file

@ -69,12 +69,19 @@ def edit(param='help'):
configuration.nginx.sites_available,
configuration.nginx.conf.name)
backup_file_path = config_file_path + '.bak'
locations = {
'conf': {
'path': config_file_path,
'desc': "nginx configuration file",
},
'backup': {
'path': backup_file_path,
'desc': "backup configuration file",
},
'log.error': {
'path': configuration.logging.nginx.error,
'desc': "nginx error log file",
@ -88,6 +95,18 @@ def edit(param='help'):
if param in locations.keys():
remote_path = locations[param]['path']
if env.debug:
logger = loggify('nginx', 'edit')
logger.debug("param: %s\n" % param)
logger.debug("locations:")
for key, value in locations.items():
logger.debug("%s [path]: %s" % (key, value['path']))
logger.debug("%s [desc]: %s\n" % (key, value['desc']))
logger.debug("remote_path: %s" % remote_path)
else:
maintenance_edit(remote_path=remote_path)
else:
# if param == 'help':