Yes, that's what I mean. Invoke the factory there, only if there's a
need to connect to the SSH agent.
Hrm...unfortunately it seems it's not quite so simple :-( This test is
also used to verify whether an agent is even available, here:
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/functions/CreateSshClientOncePortIsListeningOnNode.java#L64
Having that blow up with a NCDFError rather than a sane
IllegalArgumentException seems pretty nasty. And I don't immediately
see a way to figure out whether an agent is, in fact, available, other
than asking the ConnectorFactory to try to create one.
Which gets us back to the discussion of catching the NCDFE again :-(
Any thoughts?
Regards
ap