Skip to content

Commit

Permalink
Revert 1.2.1 shuffle tools
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Oct 22, 2024
1 parent 38a1bda commit a1170df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion shuffle-tools/1.2.0/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,11 @@ def list_cidr_ips(self, cidr):

return returnvalue

def if_else_routing(self, conditions):
def switch(self, conditions):
# Check if conditions is a list or not
if not isinstance(conditions, list):
conditions = [conditions]

# True by default
to_return = {
"success": True,
Expand Down
4 changes: 2 additions & 2 deletions shuffle-tools/1.2.0/src/switch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# self, sourcevalue, condition, destinationvalue
def run_validation(sourcevalue, check, destinationvalue):
def validate_condition(sourcevalue, check, destinationvalue):
if check == "=" or check == "==" or check.lower() == "equals":
if str(sourcevalue).lower() == str(destinationvalue).lower():
return True
Expand Down Expand Up @@ -113,7 +113,7 @@ def evaluate_conditions(condition_structure):
destination = condition_structure['destination']

# self.
return run_validation(source, condition, destination)
return validate_condition(source, condition, destination)

# Recursive case: Logical operator
elif operator == "AND":
Expand Down

0 comments on commit a1170df

Please sign in to comment.