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

pynipap: new prefix from-pool seems not to take pool's default type #1185

Open
andris opened this issue Mar 30, 2018 · 0 comments
Open

pynipap: new prefix from-pool seems not to take pool's default type #1185

andris opened this issue Mar 30, 2018 · 0 comments

Comments

@andris
Copy link

andris commented Mar 30, 2018

Thanks for the great tool that is NIPAP! Just trying some integration with my own tools via pynipap.

According to the documentation, calling save() on a new prefix calls http://nipap.readthedocs.io/en/latest/nipap.html#nipap.backend.Nipap.add_prefix

According to the add_prefix documentation: 'the type key can be omitted and the prefix type will then be set to the pools default prefix type'

However, if i try to allocate a new prefix from an existing pool that has default type 'assignment', save() fails with 'pynipap.NipapValueError: Unknown prefix type'. If i manually set the prefixes type prior to saving

example without explicitly setting type of new prefix.

testPrefix = Prefix()
testPrefix.description = "testPrefix"
testPrefix.save({ 'from-pool': samplePool, 'family': 4})

fails with pynipap.NipapValueError: Unknown prefix type

example with explicitly setting type of new prefix

testPrefix = Prefix()
testPrefix.description = "testPrefix"
testPrefix.type = "assignment"
testPrefix.save({ 'from-pool': samplePool, 'family': 4})

succeeds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant