Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle edit_prefix without VRF #1337

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions nipap/nipap/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2749,13 +2749,14 @@ def edit_prefix(self, auth, spec, attr):
'name': None
}

# Handle VRF - find the correct one and remove bad VRF keys.
vrf = self._get_vrf(auth, attr)
if 'vrf_rt' in attr:
del(attr['vrf_rt'])
if 'vrf_name' in attr:
del(attr['vrf_name'])
attr['vrf_id'] = vrf['id']
# Handle VRF in attributes - find the correct one and remove bad VRF keys.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (82 > 79 characters)

if 'vrf_rt' in attr or 'vrf_name' in attr or 'vrf_id' in attr:
vrf = self._get_vrf(auth, attr)
if 'vrf_rt' in attr:
del(attr['vrf_rt'])
if 'vrf_name' in attr:
del(attr['vrf_name'])
attr['vrf_id'] = vrf['id']

self._check_attr(attr, [], _prefix_attrs)

Expand All @@ -2780,9 +2781,6 @@ def edit_prefix(self, auth, spec, attr):
'authenticated_as': auth.authenticated_as,
'full_name': auth.full_name,
'authoritative_source': auth.authoritative_source,
'vrf_id': vrf['id'],
'vrf_rt': vrf['rt'],
'vrf_name': vrf['name']
}

for p in prefixes:
Expand Down
Loading