1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[Docker] camelize hash keys on image and container create

This commit is contained in:
Amos Benari 2014-03-03 14:32:16 +02:00
parent 2243158daf
commit 2402fb8f8b
3 changed files with 6 additions and 2 deletions

View file

@ -49,6 +49,10 @@ module Fog
hash.inject({}){ |h, v| h.merge! downcase_hash_keys(v[-1], k + [v[0]]) }
end
def camelize_hash_keys(hash)
Hash[ hash.map {|k, v| [k.to_s.camelize, v] }]
end
end
end
end

View file

@ -27,7 +27,7 @@ module Fog
#}
class Real
def container_create(attrs)
downcase_hash_keys Docker::Container.create(attrs).info
downcase_hash_keys Docker::Container.create(camelize_hash_keys(attrs)).info
end
end

View file

@ -4,7 +4,7 @@ module Fog
class Real
def image_create(attrs)
downcase_hash_keys Docker::Image.create(attrs).info
downcase_hash_keys Docker::Image.create(camelize_hash_keys(attrs)).info
end
end