don't set key_name if not provided
diff --git a/rackspace/compute/v2/servers/requests.go b/rackspace/compute/v2/servers/requests.go
index f9424df..1e17eb9 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 serverMap["key_name"] != "" {
+ serverMap["key_name"] = opts.KeyPair
+ }
return res, nil
}