diff --git a/modules/nginx.py b/modules/nginx.py index 6f3aaff..21d0c09 100644 --- a/modules/nginx.py +++ b/modules/nginx.py @@ -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,7 +95,19 @@ def edit(param='help'): if param in locations.keys(): remote_path = locations[param]['path'] - maintenance_edit(remote_path=remote_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':