opscode-cookbooks/jenkins — pull request #219 by Kasen (2014-06-06 10:03:56+00:00)
Title: Credentials fix

Compare of current_credentials and wanted_credentials arrays always return nil, if some attributes was blank. It happenes because in current_credential array blank strings were replaced on nil, but weren't in wanted_credentials.

In current realization if you want change private key, password or description in credentials lwrp, jenkins credentials will be re-create with another id. And if you have ssh slave lwrp, which use this credentials, then you get next error while running recipe:
```
STDERR: java.lang.NullPointerException: Cannot get property 'username' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:156)
...
```
It happens because jenkins_ssh_slave lwrp tries get credential's username by credential's id. But id already changed.
Re-creating credentials with another id is not idempotent. Credentials must be recreated only if id or name changed, in other case we must keep credential's id.