Skip to content

Commit f54c0cf

Browse files
committed
fix signatures
1 parent a27827f commit f54c0cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

generic_config_updater/gu_common.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def validate_field_operation(self, old_config, target_config):
166166
if any(op['op'] == operation and field == op['path'] for op in patch):
167167
raise IllegalPatchOperationError("Given patch operation is invalid. Operation: {} is illegal on field: {}".format(operation, field))
168168

169-
def _invoke_validating_function(cmd):
169+
def _invoke_validating_function(cmd, path, operation):
170170
# cmd is in the format as <package/module name>.<method name>
171171
method_name = cmd.split(".")[-1]
172172
module_name = ".".join(cmd.split(".")[0:-1])
@@ -184,6 +184,7 @@ def _invoke_validating_function(cmd):
184184

185185
for element in patch:
186186
path = element["path"]
187+
operation = element["op"]
187188
match = re.search(r'\/([^\/]+)(\/|$)', path) # This matches the table name in the path, eg if path if /PFC_WD/GLOBAL, the match would be PFC_WD
188189
if match is not None:
189190
table = match.group(1)
@@ -194,7 +195,7 @@ def _invoke_validating_function(cmd):
194195
validating_functions.update(tables.get(table, {}).get("field_operation_validators", []))
195196

196197
for function in validating_functions:
197-
if not _invoke_validating_function(function):
198+
if not _invoke_validating_function(function, path, operation):
198199
raise IllegalPatchOperationError("Modification of {} table is illegal- validating function {} returned False".format(table, function))
199200

200201

0 commit comments

Comments
 (0)