jeremyschulman / netbox-plugin-auth-saml2

Netbox plugin for SSO using SAML2
120 stars 21 forks source link

Netbox now call validate() with a 3rd arg. #15

Closed ylmrx closed 3 years ago

ylmrx commented 3 years ago

cf. https://github.com/netbox-community/netbox/commit/13a13f3943c933fc43be0e135a6dc78f460fba0f

Also the version number in init was off. :)

calcinai commented 3 years ago

@ylmrx I just came here to make this exact PR

jeremyschulman commented 3 years ago

@ylmrx - Thank you. Did you back-test this change against the Netbox 2.8 release? I don't recall this third arg was present then. Please confirm and we can go from there. Thank you.

gmazoyer commented 3 years ago

This change will probably break the plugin for NetBox < 2.10. I'm not sure how to proceed to keep the plugin compatible with this breaking change. Maybe by using *args as function parameter?

def validate(cls, user_config, *args):
    if len(args) == 1:
        super().validate(user_config, args[0])
    else:
        super().validate(user_config)
jeremyschulman commented 3 years ago

This change will probably break the plugin for NetBox < 2.10. I'm not sure how to proceed to keep the plugin compatible with this breaking change. Maybe by using *args as function parameter?

def validate(cls, user_config, *args):
    if len(args) == 1:
        super().validate(user_config, args[0])
    else:
        super().validate(user_config)

Yes, that would be AOK. Please make that change and I will merge. Really appreciate your contribution!

jeremyschulman commented 3 years ago

@ylmrx - thank you! I will roll a release and upload to PyPi tomorrow.