X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_policy_module%2Fcmd%2Fpolicy_module_healthcheck.py;h=23fb6a735d46c7c10cd734ecf50215456260dfcf;hb=8537aea539c90c284f2d9a303533950e3853d1da;hp=de85ad0b329d0703e180bc250cfdb72b28a91e17;hpb=e8ee171063d81a02033729273793f5ba2c2b71cc;p=osm%2FPOL.git diff --git a/osm_policy_module/cmd/policy_module_healthcheck.py b/osm_policy_module/cmd/policy_module_healthcheck.py index de85ad0..23fb6a7 100644 --- a/osm_policy_module/cmd/policy_module_healthcheck.py +++ b/osm_policy_module/cmd/policy_module_healthcheck.py @@ -29,8 +29,8 @@ log = logging.getLogger(__name__) def main(): - parser = argparse.ArgumentParser(prog='osm-policy-healthcheck') - parser.add_argument('--config-file', nargs='?', help='POL configuration file') + parser = argparse.ArgumentParser(prog="osm-policy-healthcheck") + parser.add_argument("--config-file", nargs="?", help="POL configuration file") # args = parser.parse_args() # cfg = Config(args.config_file) @@ -46,20 +46,20 @@ def _processes_running(): return True return False - processes_to_check = ['osm-policy-agent'] - ps = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE).communicate()[0] - processes_running = ps.decode().split('\n') + processes_to_check = ["osm-policy-agent"] + ps = subprocess.Popen(["ps", "aux"], stdout=subprocess.PIPE).communicate()[0] + processes_running = ps.decode().split("\n") for p in processes_to_check: if not _contains_process(processes_running, p): log.error("Process %s not running!" % p) return False # Check if process is running properly (listening to kafka bus) - if os.path.exists('/tmp/osm_pol_agent_health_flag'): + if os.path.exists("/tmp/osm_pol_agent_health_flag"): return True else: return False -if __name__ == '__main__': +if __name__ == "__main__": main()