refs #634 - Modify 'getRepoStatus.py' and documentation
parent
e49bde25e3
commit
d1fa8a6037
|
@ -116,7 +116,7 @@ curl -X GET -H "Authorization: $API_KEY" http://example.com/ogrepository/v1/stat
|
|||
"udp-sender": "stopped",
|
||||
"uftp": "stopped",
|
||||
"bttrack": "stopped",
|
||||
"btlaunchmany": "stopped"
|
||||
"btlaunchmany.bittornado": "stopped"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -138,7 +138,7 @@ paths:
|
|||
bttrack:
|
||||
type: string
|
||||
example: "stopped"
|
||||
btlaunchmany:
|
||||
btlaunchmany.bittornado:
|
||||
type: string
|
||||
example: "stopped"
|
||||
"500 (Error)":
|
||||
|
|
|
@ -59,10 +59,10 @@ def get_service_status(service):
|
|||
def get_process_status(process):
|
||||
""" Obtiene y retorna el estado del proceso que recibe como parámetro.
|
||||
"""
|
||||
#for proc in psutil.process_iter(['pid', 'name', 'status']):
|
||||
for proc in psutil.process_iter(['name']):
|
||||
if proc.info['name'] == process:
|
||||
if proc.info['name'] in process:
|
||||
return 'running'
|
||||
# Esto no debe ir asociado a un "else" (porque comprueba todos los procesos):
|
||||
return 'stopped'
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ def main():
|
|||
services_status = {service: get_service_status(service) for service in service_list}
|
||||
|
||||
# Obtenemos el estado de los procesos listados, que almacenamos en un diccionario:
|
||||
process_list = ['udp-sender', 'uftp', 'bttrack', 'btlaunchmany']
|
||||
process_list = ['udp-sender', 'uftp', 'bttrack', 'btlaunchmany.bittornado']
|
||||
process_status = {process: get_process_status(process) for process in process_list}
|
||||
|
||||
# Creamos un diccionario con toda la información obtenida:
|
||||
|
|
Loading…
Reference in New Issue