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:
parent
2243158daf
commit
2402fb8f8b
3 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue