Skip to content

Commit ca22996

Browse files
committed
Check timestamps before calculating time diffs
1 parent 7675751 commit ca22996

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

acm-deploy-load/analyze-imagebasedgroupupgrades.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,12 @@ def main():
296296
log_write(stats_file, "Expected OCP Version {}".format(cliargs.ocp_version))
297297
log_write(stats_file, "Total IBGUs: {}".format(len(ibgus)))
298298
total_clusters = 0
299-
total_prep_duration = (latest_PrepCompletionTime - earliest_PrepStartTime).total_seconds()
300-
total_upgrade_duration = (latest_UpgradeCompletionTime - earliest_UpgradeStartTime).total_seconds()
299+
total_prep_duration = 0
300+
total_upgrade_duration = 0
301+
if earliest_PrepStartTime != "" and latest_PrepCompletionTime != "":
302+
total_prep_duration = (latest_PrepCompletionTime - earliest_PrepStartTime).total_seconds()
303+
if earliest_UpgradeStartTime != "" and latest_UpgradeCompletionTime != "":
304+
total_upgrade_duration = (latest_UpgradeCompletionTime - earliest_UpgradeStartTime).total_seconds()
301305
all_prepDurations = []
302306
all_upgradeDurations = []
303307
all_rollbackDurations = []

0 commit comments

Comments
 (0)