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

unable to access 'special case' objects #16

Open
gr33dypr0d87 opened this issue Jan 31, 2020 · 2 comments
Open

unable to access 'special case' objects #16

gr33dypr0d87 opened this issue Jan 31, 2020 · 2 comments

Comments

@gr33dypr0d87
Copy link

I am unable to access child objects that don't fall under record:*. This would include anything under discovery, or, grid. Under the class 'InfobloxWAPI' the definition getattr() originally only looks for 'record' and replaces '_' with ':' to complete the corrected URI. I have added additional if statements below to catch the remaining parent objects. Please see the modified getattr() definition below:

def getattr(self, attr):
"""
Dynamically create a new Infoblox object class, e.g. 'network'

    """
    # Special case for 'record' objects.
    #
    # The Infoblox 'record' objects are in the following form:
    #
    #     'record:<objtype>'
    #
    # For example A records in Infoblox are 'record:a' objects.
    #
    # In order to use an Infoblox 'record' object replace the
    # colon character with underscore in your call, e.g. 'record_a'
    if 'record' in attr:
        attr = attr.replace('_', ':', 1)
    if 'discovery' in attr:
        attr = attr.replace('_',':',1)
    if 'dtc' in attr:
        attr = attr.replace('_', ':', 1)
    if 'grid' in attr:
        attr = attr.replace('_', ':', 1)
    return InfobloxWAPIObject(
        objtype=attr,
        wapi=self.wapi,
        session=self.session
    )
@dnaeon
Copy link
Owner

dnaeon commented Jan 31, 2020

Please consider submitting a PR. Thanks!

@nixnerd2038
Copy link

Fixed. #17

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

3 participants