Remove Nova instance metadata limit

Rackspace cloud limits instance metadata to 5 key-value pairs, but
upstream Nova only sets the limit at 128 by default.  This patch removes
the limit entirely; the official python clients don't check it and the
server is responsible for enforcing it anyway.

Fixes:  https://issues.apache.org/jira/browse/JCLOUDS-507
This commit is contained in:
Joel Friedly 2014-03-21 15:25:04 -07:00 committed by Zack Shoylev
parent 7588d2fba4
commit b93cfa42e1
1 changed files with 1 additions and 4 deletions

View File

@ -292,13 +292,10 @@ public class CreateServerOptions implements MapBinder {
* Custom cloud server metadata can also be supplied at launch time. This * Custom cloud server metadata can also be supplied at launch time. This
* metadata is stored in the API system where it is retrievable by querying * metadata is stored in the API system where it is retrievable by querying
* the API for server status. The maximum size of the metadata key and value * the API for server status. The maximum size of the metadata key and value
* is each 255 bytes and the maximum number of key-value pairs that can be * is each 255 bytes.
* supplied per server is 5.
*/ */
public CreateServerOptions metadata(Map<String, String> metadata) { public CreateServerOptions metadata(Map<String, String> metadata) {
checkNotNull(metadata, "metadata"); checkNotNull(metadata, "metadata");
checkArgument(metadata.size() <= 5,
"you cannot have more then 5 metadata values. You specified: " + metadata.size());
for (Entry<String, String> entry : metadata.entrySet()) { for (Entry<String, String> entry : metadata.entrySet()) {
checkArgument( checkArgument(
entry.getKey().getBytes().length < 255, entry.getKey().getBytes().length < 255,