cncflora_commons 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cncflora_commons.rb +3 -3
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -82,17 +82,17 @@ def flatten(obj)
|
|
82
82
|
flat
|
83
83
|
end
|
84
84
|
|
85
|
-
def etcd2config(server,prefix)
|
85
|
+
def etcd2config(server,prefix="")
|
86
86
|
config = flatten( http_get("#{server}/v2/keys/?recursive=true")["node"] )
|
87
87
|
config.keys.each {|k|
|
88
|
-
if k.to_s.
|
88
|
+
if k.to_s.end_with?("_url") then
|
89
89
|
config[k.to_s.gsub(prefix,"").gsub("_url","").to_sym] = config[k]
|
90
90
|
end
|
91
91
|
}
|
92
92
|
config
|
93
93
|
end
|
94
94
|
|
95
|
-
def etcd2settings(server,prefix)
|
95
|
+
def etcd2settings(server,prefix="")
|
96
96
|
config = etcd2config(server,prefix)
|
97
97
|
config.keys.each { |key| set key, config[key] }
|
98
98
|
set :config, config
|