X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=tutorials%2FApacheCNF%2Fautomation%2Fhealthcheck.py;fp=tutorials%2FApacheCNF%2Fautomation%2Fhealthcheck.py;h=6fe723971333eb3ec6007e30faeaa48e428c83f6;hb=5762244a0c6282557169c8183e464f6950438122;hp=9c33375e38c533bc85776ed9bd377b9355a03072;hpb=0c85ee9fc85870f8ba39befc63b8351301d4842f;p=demo.git diff --git a/tutorials/ApacheCNF/automation/healthcheck.py b/tutorials/ApacheCNF/automation/healthcheck.py index 9c33375e..6fe72397 100644 --- a/tutorials/ApacheCNF/automation/healthcheck.py +++ b/tutorials/ApacheCNF/automation/healthcheck.py @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (C) 2021 Samsung +# Modification Copyright (C) 2022 Deutsche Telekom AG # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +17,7 @@ # ============LICENSE_END========================================================= import logging import os +import sys import zipfile from io import BytesIO @@ -61,7 +63,7 @@ def resolve_hc_inputs(config: Config): vnf_id = vnfs[0].vnf_id return service_id, vnf_id -def main(): +def main(status_count): mypath = os.path.dirname(os.path.realpath(__file__)) config = Config(env_dict=VariablesDict.env_variable) for vnf in config.service_model["vnfs"]: @@ -77,7 +79,8 @@ def main(): cds_input = {"health-check-properties": { "service-instance-id": serv_id, - "vnf-id": vnf_id + "vnf-id": vnf_id, + "status-check-max-count": int(status_count) } } @@ -90,4 +93,8 @@ def main(): logger.info("Please check cds-blueprints-processor logs to see exact status") if __name__ == "__main__": - main() + status_count = 1 + if len(sys.argv) > 1: + status_count = sys.argv[1] + print(f"Status Check Max Count: %s" % status_count) + main(status_count)