With some(?) versions of juniper, the existing code
simply submits the continue button, which does not terminate
existing connections. If only a single session is allowed, this
results in the terminate connections page being redisplayed.
With this change, we select the first connection, clear the
disabled attribute from the terminate button and then submit it.
While this appears to be what the juniper client normally does,
this behavior is only enabled with a new terminate option, as
I'm not sure that if multiple sessions are allowed for the current
user we want to be arbitrary terminating them.
It also seems that juniper may send invalid HTML that mechanize
can't clearly parse. We fix this by removing the comma, and
recreating the response.
Also, added a debug option which turns on some basic logging.
Signed-off-by: Jeremy Linton lintonrjeremy@gmail.com
With some(?) versions of juniper, the existing code simply submits the continue button, which does not terminate existing connections. If only a single session is allowed, this results in the terminate connections page being redisplayed.
With this change, we select the first connection, clear the disabled attribute from the terminate button and then submit it. While this appears to be what the juniper client normally does, this behavior is only enabled with a new terminate option, as I'm not sure that if multiple sessions are allowed for the current user we want to be arbitrary terminating them.
It also seems that juniper may send invalid HTML that mechanize can't clearly parse. We fix this by removing the comma, and recreating the response.
Also, added a debug option which turns on some basic logging.
Signed-off-by: Jeremy Linton lintonrjeremy@gmail.com