Release v0.4.2:

- WAMP alive RPC refactored
 - WSTUN tunnels monitoring: added recovery procedure
 - NGINX proxy updated
 - Iotronic oslo conf refactored
 - Pyinotify requirement added

Change-Id: I3f341148294230af9d1e1943c5186fec1c7b18db
This commit is contained in:
Nicola Peditto 2018-12-05 18:29:23 +01:00
parent 021a7a143c
commit 2523e33d78
2 changed files with 5 additions and 55 deletions

View File

@ -107,36 +107,6 @@ class ProxyManager(Proxy.Proxy):
nginxMsg = json.dumps(nginxMsg)
return nginxMsg
def _proxyStatus(self):
nginxMsg = {}
try:
stat = subprocess.Popen(
'systemctl status nginx.service',
shell=True,
stdout=subprocess.PIPE
)
stdout_list = str(stat.communicate()[0]).split('\n')
for line in stdout_list:
if 'Active:' in line:
if '(running)' in line:
nginxMsg['log'] = "NGINX is running"
nginxMsg['status'] = True
# LOG.info("--> " + nginxMsg['log'])
else:
nginxMsg['log'] = "NGINX is not running"
nginxMsg['status'] = False
# LOG.warning("--> " + nginxMsg['log'])
except Exception as err:
nginxMsg['log'] = "Error check NGINX status: " + str(err)
nginxMsg['status'] = True
# LOG.error("--> " + nginxMsg['log'])
return json.dumps(nginxMsg)
def _proxyReload(self):
nginxMsg = {}
@ -145,7 +115,7 @@ class ProxyManager(Proxy.Proxy):
try:
stat = subprocess.call('service nginx reload', shell=True)
stat = subprocess.call('nginx -s reload', shell=True)
if stat != 0:
raise NginxError(str(stat))
@ -387,7 +357,7 @@ class ProxyManager(Proxy.Proxy):
return service_list
async def NginxInfo(self):
async def ProxyInfo(self):
rpc_name = utils.getFuncName()
LOG.info("RPC " + rpc_name + " CALLED")
@ -397,17 +367,7 @@ class ProxyManager(Proxy.Proxy):
return w_msg.serialize()
async def NginxStatus(self):
rpc_name = utils.getFuncName()
LOG.info("RPC " + rpc_name + " CALLED")
message = self._proxyStatus()
w_msg = WM.WampSuccess(message)
return w_msg.serialize()
async def NginxReload(self):
async def ProxyReload(self):
rpc_name = utils.getFuncName()
LOG.info("RPC " + rpc_name + " CALLED")
@ -417,7 +377,7 @@ class ProxyManager(Proxy.Proxy):
return w_msg.serialize()
async def NginxRestart(self):
async def ProxyRestart(self):
rpc_name = utils.getFuncName()
LOG.info("RPC " + rpc_name + " CALLED")
@ -426,13 +386,3 @@ class ProxyManager(Proxy.Proxy):
w_msg = WM.WampSuccess(message)
return w_msg.serialize()
async def NginxIotronicConf(self):
rpc_name = utils.getFuncName()
LOG.info("RPC " + rpc_name + " CALLED")
message = self._proxyIotronicConf()
w_msg = WM.WampSuccess(message)
return w_msg.serialize()

View File

@ -9,4 +9,4 @@ httplib2>=0.9.1 # MIT
psutil>=5.4.7 # BSD
oslo.config>=5.1.0 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0
pyinotify>=0.9.6 # MIT
pyinotify>=0.9.6;sys_platform!='win32' and sys_platform!='darwin' and sys_platform!='sunos5' # MIT