-
Notifications
You must be signed in to change notification settings - Fork 30
(repost) - Obtain version on class init, allow compatibility with 2.x and 3.x APIs. #168
Conversation
This should be optional. We use ISE through APIs and have no desire to do an extra API call for every request that hit our API (new class is instanced for each request) |
After thinking on this more... I split up the code into 2 optional parameters, and went ahead and added the failover support to this PR (hope that's not too much, but it seemed be related so we could all see how it looks) Version Discovery - on by default, toggle by setting the version on init: HA Discovery off by default, toggle on with a boolean variable: Possible improvement to do is that the library only takes 1 IP today. The failover discovery will work as long as that IP has either Active or Standby role. If it's standby, it will find the other primary node, and assign it to the class on init, so all future calls will use the discovered IP. I could just add a new parameter - secondary_ise_node, or ise_node2, and run queries there if the primary is offline. Thoughts? |
ise.py
Outdated
print("Error: Connection Error to Secondary ISE Node.") | ||
raise | ||
except requests.exceptions.RequestException as e: | ||
print("Error: Connection Error to Secondary ISE Node.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All prints should be converted into logging statements.
import logging
log = logging.getLogger('ise')
log.debug(…)
log.warning(…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added logging to replace prints.
I will check this out as soon as #164 is done And I am sorry for taking so much time with this.. -- |
Yeah, they need both MnT and ERS group rights in current code, which may be a little unexpected. I have an idea. I just found an ISE ERS API call that will let us query if the ERS node is primary or not, and even see the secondary. I can move this feature down to the ERS only permission. I can build changes to use ERS only, and fix the conflict - any other changes requested? |
@jasonbarbee That would be great! -- |
Any more information on this, I'm trying to clean up some PR's before 0.3. |
Closing this. Really sorry for the trouble. |
Per comments of PR #151, @falkowich you asked me to recommit. I re-synced with master, and tried to re-commit. Pardon the "new line" I couldn't seem to match that, I didn't want to change any code there, it seems some kind of editor issue.