Merge pull request #432 from jrperritt/rs-keypair-fix
Rackspace keypair fix
diff --git a/rackspace/compute/v2/servers/requests.go b/rackspace/compute/v2/servers/requests.go
index f9424df..d4472a0 100644
--- a/rackspace/compute/v2/servers/requests.go
+++ b/rackspace/compute/v2/servers/requests.go
@@ -117,7 +117,9 @@
// key_name doesn't actually come from the extension (or at least isn't documented there) so
// we need to add it manually.
serverMap := res["server"].(map[string]interface{})
- serverMap["key_name"] = opts.KeyPair
+ if opts.KeyPair != "" {
+ serverMap["key_name"] = opts.KeyPair
+ }
return res, nil
}