diff --git a/deploy-agent/deployd/client/client.py b/deploy-agent/deployd/client/client.py index c25ac5ccf2..a6059ec227 100644 --- a/deploy-agent/deployd/client/client.py +++ b/deploy-agent/deployd/client/client.py @@ -139,6 +139,7 @@ def _read_host_info(self): except Exception: log.warn('Host ip information does not exist.') pass + IS_PINTEREST=True if IS_PINTEREST and self._use_host_info is False: # Read new keys from facter always diff --git a/deploy-agent/deployd/common/utils.py b/deploy-agent/deployd/common/utils.py index 7b6725d59f..7e3c738141 100644 --- a/deploy-agent/deployd/common/utils.py +++ b/deploy-agent/deployd/common/utils.py @@ -233,11 +233,11 @@ def redeploy_check_container(labels, service, redeploy) -> int: return 0 def redeploy_check_non_container(commit, service, redeploy, healthcheckConfigs): - if "HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY" in healthcheckConfigs and healthcheckConfigs["HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY"] == "True": + if healthcheckConfigs.get("HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY") == "True": log.info(f"Auto redeployment is enabled on service {service}") - if "HEALTHCHECK_REDEPLOY_MAX_RETRY" in healthcheckConfigs and redeploy < int(healthcheckConfigs["HEALTHCHECK_REDEPLOY_MAX_RETRY"]) or \ - "HEALTHCHECK_REDEPLOY_MAX_RETRY" not in healthcheckConfigs and redeploy < 3: - log.info(f"current redeploy is {redeploy}") + max_retry = int(healthcheckConfigs.get("HEALTHCHECK_REDEPLOY_MAX_RETRY", REDEPLOY_MAX_RETRY)) + if redeploy < max_retry: + log.info(f"redeploy is {redeploy}; max retry is {max_retry}") send_statsboard_metric(name='deployd.service_health_status', value=1, tags={"status": "redeploy", "service": service, "commit": commit}) return "redeploy-" + str(redeploy + 1)