Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce not version in this scene and Unadapted by version SKIP log le… #202

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def filter_by_version(scene, cluster, stdio=None):
break
steps_nu = steps_nu + 1
if steps_nu > len(steps) - 1:
stdio.warn("not version in this scene")
stdio.verbose("not version in this scene")
return -1
return steps_nu
except Exception as e:
Expand Down
55 changes: 28 additions & 27 deletions handler/checker/result/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,56 +87,57 @@ def _verify_base(self):

def _verify_max(self):
try:
if isinstance(self.env_dict[self.now_step_set_value_name], decimal.Decimal):
self.env_dict[self.now_step_set_value_name] = int(self.env_dict[self.now_step_set_value_name])
if not isinstance(self.env_dict[self.now_step_set_value_name], (int, float, decimal.Decimal)):
raise Exception(
"{0} is {1} and the type is {2}, not int or float or decimal !".format(self.now_step_set_value_name,
the_num = self.env_dict[self.now_step_set_value_name]
if isinstance(the_num, decimal.Decimal):
the_num= int(self.env_dict[self.now_step_set_value_name])
if not isinstance(the_num, (int, float, decimal.Decimal)):
self.stdio.warn(
"{0} is {1} and the type is {2}, not int or float or decimal ! set it to 0.".format(self.now_step_set_value_name,
self.env_dict[
self.now_step_set_value_name],
type(self.env_dict[
self.now_step_set_value_name])))
the_num=0
range_str = self.expr
result = int(self.env_dict[self.now_step_set_value_name]) < int(range_str)
return result
return int(the_num) < int(range_str)
except Exception as e:
self.stdio.error("_verify_max error: {0} -> {1}".format(str(self.expr), e))
raise VerifyFalseException(e)

def _verify_min(self):
try:
if isinstance(self.env_dict[self.now_step_set_value_name], decimal.Decimal):
self.env_dict[self.now_step_set_value_name] = int(self.env_dict[self.now_step_set_value_name])
if not isinstance(self.env_dict[self.now_step_set_value_name], (int, float, decimal.Decimal)):
raise Exception(
"{0} is {1} and the type is {2}, not int or float ordecimal !".format(self.now_step_set_value_name,
self.env_dict[
self.now_step_set_value_name],
type(self.env_dict[
self.now_step_set_value_name])))
the_num = self.env_dict[self.now_step_set_value_name]
if isinstance(the_num, decimal.Decimal):
the_num= int(self.env_dict[self.now_step_set_value_name])
if not isinstance(the_num, (int, float, decimal.Decimal)):
self.stdio.warn(
"{0} is {1} and the type is {2}, not int or float or decimal ! set it to 0.".format(self.now_step_set_value_name,
self.env_dict[
self.now_step_set_value_name],
type(self.env_dict[
self.now_step_set_value_name])))
the_num=0
range_str = self.expr
result = int(self.env_dict[self.now_step_set_value_name]) > int(range_str)
return result
return int(the_num) > int(range_str)
except Exception as e:
self.stdio.error("_verify_min error: {0} -> {1}".format(str(self.expr), e))
raise VerifyFalseException(e)

def _verify_equal(self):
try:
if isinstance(self.env_dict[self.now_step_set_value_name], decimal.Decimal):
self.env_dict[self.now_step_set_value_name] = int(self.env_dict[self.now_step_set_value_name])
if not isinstance(self.env_dict[self.now_step_set_value_name], (int, float, decimal.Decimal)):
raise Exception(
"{0} is {1} and the type is {2}, not int or float or decimal !".format(self.now_step_set_value_name,
the_num = self.env_dict[self.now_step_set_value_name]
if isinstance(the_num, decimal.Decimal):
the_num= int(self.env_dict[self.now_step_set_value_name])
if not isinstance(the_num, (int, float, decimal.Decimal)):
self.stdio.warn(
"{0} is {1} and the type is {2}, not int or float or decimal ! set it to 0.".format(self.now_step_set_value_name,
self.env_dict[
self.now_step_set_value_name],
type(self.env_dict[
self.now_step_set_value_name])))
result = False
the_num=0
range_str = self.expr
if int(self.env_dict[self.now_step_set_value_name]) == int(range_str):
result = True
return int(self.env_dict[self.now_step_set_value_name]) == int(range_str)
except Exception as e:
self.stdio.error("_verify_equal error: {0} -> {1}".format(str(self.expr), e))
raise VerifyFailException(e)
return result
2 changes: 1 addition & 1 deletion handler/gather/scenes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def execute(self):
def __execute_yaml_mode(self, nodes):
steps_nu = filter_by_version(self.scene, self.cluster, self.stdio)
if steps_nu < 0:
self.stdio.warn("Unadapted by version. SKIP")
self.stdio.verbose("Unadapted by version. SKIP")
return "Unadapted by version.SKIP"
self.stdio.verbose("filter_by_version is return {0}".format(steps_nu))
if len(nodes)==0:
Expand Down
Loading