add backup to nginx.edit optiosn
This commit is contained in:
parent
4c413005c1
commit
43fd9e4cd7
1 changed files with 20 additions and 1 deletions
|
|
@ -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':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue