Skip to content

Commit

Permalink
[GCU] Supressing YANG errors from libyang while sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
ghooo committed Dec 28, 2021
1 parent fbd565d commit 36b165d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generic_config_updater/patch_sorter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,8 @@ def __init__(self, config_wrapper, patch_wrapper, sort_algorithm_factory=None):
SortAlgorithmFactory(self.operation_wrapper, config_wrapper, self.path_addressing)

def sort(self, patch, algorithm=Algorithm.DFS, preloaded_current_config=None):
import yang
yang.set_log_options(6)
current_config = preloaded_current_config if preloaded_current_config else self.config_wrapper.get_config_db_as_json()
target_config = self.patch_wrapper.simulate_patch(patch, current_config)

Expand All @@ -1352,4 +1354,5 @@ def sort(self, patch, algorithm=Algorithm.DFS, preloaded_current_config=None):

changes = [JsonChange(move.patch) for move in moves]

yang.set_log_options(7)
return changes

0 comments on commit 36b165d

Please sign in to comment.