Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xincunli-sonic committed Oct 29, 2024
1 parent 26ee2a4 commit 816dc9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generic_config_updater/generic_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

def extract_scope(path):
if not path:
raise Exception("Wrong patch with empty path.")
raise GenericConfigUpdaterError("Wrong patch with empty path.")
pointer = jsonpointer.JsonPointer(path)

# Re-escapes `/` in path parts by converting `/` back to `~1`.
parts = [part.replace("/", "~1") for part in pointer.parts]
# Re-escapes
parts = [jsonpointer.escape(part) for part in pointer.parts]
if not parts:
raise GenericConfigUpdaterError("Wrong patch with empty path.")
if parts[0].startswith("asic"):
Expand Down

0 comments on commit 816dc9c

Please sign in to comment.