Generate msi token only when using AMCS
@@ -508,6 +508,12 @@ def metrics_watcher(hutil_error, hutil_log):
while True:
try:
+ if os.path.isfile(MdsdCounterJsonPath):
+ f = open(MdsdCounterJsonPath, "r")
+ data = f.read()
+
+ if (data != ''):
+ crc = hashlib.sha256(data).hexdigest()
generate_token = False
me_token_path = os.path.join(os.getcwd(), "/config/metrics_configs/AuthToken-MSI.json")
@@ -537,12 +543,6 @@ def metrics_watcher(hutil_error, hutil_log):
else:
hutil_error(log_messages)
- if os.path.isfile(MdsdCounterJsonPath):
- f = open(MdsdCounterJsonPath, "r")
- data = f.read()
-
- if (data != ''):
- crc = hashlib.sha256(data).hexdigest()
if(crc != last_crc):
hutil_log("Start processing metric configuration")
hutil_log(data)
