diff --git a/hm_pyhelper/miner_param.py b/hm_pyhelper/miner_param.py index 80f5f09..492bc5d 100644 --- a/hm_pyhelper/miner_param.py +++ b/hm_pyhelper/miner_param.py @@ -1,8 +1,6 @@ import os import subprocess import json -from time import sleep -from random import randint from packaging.version import Version from retry import retry @@ -170,31 +168,19 @@ def provision_key(): if did_gateway_mfr_test_result_include_miner_key_pass(test_results): return True - provisioning_successful = False - retries = 0 - max_retries = 5 - - while not provisioning_successful: - try: - gateway_mfr_result = run_gateway_mfr(["provision"]) - LOGGER.info("[ECC Provisioning] %s", gateway_mfr_result) - provisioning_successful = True - break - - except subprocess.CalledProcessError: - LOGGER.error("[ECC Provisioning] Exited with a non-zero status") - - except Exception as exp: - LOGGER.error("[ECC Provisioning] Error during provisioning. %s" % str(exp)) + try: + gateway_mfr_result = run_gateway_mfr(["provision"]) + LOGGER.info("[ECC Provisioning] %s", gateway_mfr_result) - retries += 1 - if retries >= max_retries: - break + except subprocess.CalledProcessError: + LOGGER.error("[ECC Provisioning] Exited with a non-zero status") + return False - sleep(randint(1, 5)) # NOSONAR - LOGGER.info("[ECC Provisioning] Retrying ...") + except Exception as exp: + LOGGER.error("[ECC Provisioning] Error during provisioning. %s" % str(exp)) + return False - return provisioning_successful + return True def did_gateway_mfr_test_result_include_miner_key_pass( diff --git a/setup.py b/setup.py index ae11b06..e25e49b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='hm_pyhelper', - version='0.13.33', + version='0.13.34', author="Nebra Ltd", author_email="support@nebra.com", description="Helium Python Helper",