Skip to content

Commit

Permalink
add the patch position to the file
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephine.Rutten committed Dec 16, 2024
1 parent 6c3b298 commit 40d8114
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cnaas_nms/api/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"redundant_link": fields.Boolean(required=False, example=True),
"tags": fields.List(fields.String(), required=False, description="List of tags", example=["tag1", "tag2"]),
"cli_append_str": fields.String(required=False),
"patch_position": fields.String(
required=False,
description="Patch Position",
),
},
)

Expand Down Expand Up @@ -270,6 +274,13 @@ def put(self, hostname):
errors.append(
"cli_append_str must be a string, got: {}".format(if_dict["data"]["cli_append_str"])
)
if "patch_postion" in if_dict["data"]:
if isinstance(if_dict["data"]["patch_postion"], str):
intfdata["patch_postion"] = if_dict["data"]["patch_postion"]
else:
errors.append(
"patch_postion must be a string, got: {}".format(if_dict["data"]["patch_postion"])
)
elif "data" in if_dict and not if_dict["data"]:
intfdata: None = None # type: ignore [no-redef]

Expand Down

0 comments on commit 40d8114

Please sign in to comment.