Merge pull request #619 from aplowe/openstack-nova

openstack-nova: fixing NPE in CreateServerOptions.string()
This commit is contained in:
Adrian Cole 2012-05-09 08:42:15 -07:00
commit 9a4e5fd7d8
1 changed files with 3 additions and 5 deletions

View File

@ -133,9 +133,10 @@ public class CreateServerOptions implements MapBinder {
} }
protected ToStringHelper string() { protected ToStringHelper string() {
return toStringHelper("").add("keyName", "keyName").add("securityGroupNames", securityGroupNames) return toStringHelper("").add("keyName", keyName).add("securityGroupNames", securityGroupNames)
.add("metadata", metadata).add("personality", personality) .add("metadata", metadata).add("personality", personality)
.add("adminPassPresent", adminPass != null).add("userData", new String(userData)); .add("adminPassPresent", adminPass != null)
.add("userData", userData == null ? null : new String(userData));
} }
@Override @Override
@ -258,9 +259,6 @@ public class CreateServerOptions implements MapBinder {
/** /**
* A keypair name can be defined when creating a server. This key will be * A keypair name can be defined when creating a server. This key will be
* linked to the server and used to SSH connect to the machine * linked to the server and used to SSH connect to the machine
*
* @param keyName
* @return
*/ */
public String getKeyPairName() { public String getKeyPairName() {
return keyName; return keyName;