fix(rollback): use == instead of is for boolean check in execute_roll… (#1207)

* fix(rollback): use == instead of is for boolean check in execute_rollback_version_files

Signed-off-by: Nitesh <nitesh@example.com>

* fix(rollback): fix indentation in execute_rollback_version_files and add license header

Signed-off-by: Nitesh <nitesh@example.com>

---------

Signed-off-by: Nitesh <nitesh@example.com>
Co-authored-by: Nitesh <nitesh@example.com>
Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
This commit is contained in:
NITESH SINGH
2026-03-30 10:56:36 -04:00
committed by GitHub
co-authored by Nitesh Paige Patton
parent d55695f7c4
commit 8c57b0956b
+18 -2
View File
@@ -1,3 +1,19 @@
#!/usr/bin/env python
#
# Copyright 2025 The Krkn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
import logging
@@ -132,8 +148,8 @@ def execute_rollback_version_files(
:param ignore_auto_rollback_config: Flag to ignore auto rollback configuration. Will be set to True for manual execute-rollback calls.
"""
if not ignore_auto_rollback_config and RollbackConfig().auto is False:
logger.warning(f"Auto rollback is disabled, skipping execution for run_uuid={run_uuid or '*'}, scenario_type={scenario_type or '*'}")
return
logger.warning(f"Auto rollback is disabled, skipping execution for run_uuid={run_uuid or '*'}, scenario_type={scenario_type or '*'}")
return
# Get the rollback versions directory
version_files = RollbackConfig.search_rollback_version_files(run_uuid, scenario_type)