jenkinsci/jclouds-plugin — pull request #40 by aklochkovgd (2013-03-25 21:04:29+00:00)
Title: Save VM credentials in config to be able to reconnect to slaves

Currently the plugin takes VM credentials via JClouds, using NodeMetadata.getCredentials. This works when a VM is just created, but if there's a need to reconnect to VM and do bootstrap again (like when restarting Jenkins), this doesn't work as JClouds doesn't provide credentials at that time, as confirmed by NodeMetadata.getCredentials javadoc:

```java
/**
* If possible, these are returned upon all detail requests. However, it is often the case that
* credentials are only available when a node is initially created.
*
* @see ComputeServiceContext#credentialStore
*/
@Nullable
LoginCredentials getCredentials();
```

To fix this I'm proposing to store credentials as a part of plugin configuration. The fix is tested with OpenStack, using openstack-nova provider.