brocade_vrouter 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/brocade_vrouter/configuration.rb +0 -1
- data/lib/brocade_vrouter/configurator.rb +16 -11
- data/lib/brocade_vrouter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27e8f859934fb6b76803b2ccd907db3143b1fc36
|
4
|
+
data.tar.gz: bb175b3a07aeba1cfd184004bb5d5df3dec191cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64f99f9a1bc26f324b064b23060d2cb0001cb4166ea8b3e9058ea1453673f0b9e1ccf38775781e52dc3f5d4b2175cb2fa220b0263827d08771aa9aebae5f1289
|
7
|
+
data.tar.gz: c1997ae826cd49da9e8c05e294e0892e2a042296285f26a04768223b72d654cb27e5a7b4ea9ba368dfb7d93c502fe57daa0eed80d24b0f3473088567758fa0ef
|
@@ -38,9 +38,17 @@ module BrocadeVRouter
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def get
|
41
|
-
|
42
|
-
|
43
|
-
|
41
|
+
path = 'rest/op/show/configuration'
|
42
|
+
handle_request :post, path
|
43
|
+
resp = handle_response connection.post "/#{path}"
|
44
|
+
|
45
|
+
return unless resp.success?
|
46
|
+
|
47
|
+
path = "#{resp.headers['location']}"
|
48
|
+
handle_request :get, path
|
49
|
+
resp = handle_response connection.get "/#{path}"
|
50
|
+
|
51
|
+
Configuration.new(resp.body).to_h if resp.success?
|
44
52
|
end
|
45
53
|
|
46
54
|
def delete(paths = nil, &blk)
|
@@ -102,11 +110,11 @@ module BrocadeVRouter
|
|
102
110
|
|
103
111
|
message = "< #{resp.env.method.upcase} #{resp.env.url} #{resp.env.status}\n#{resp.body}"
|
104
112
|
|
105
|
-
if
|
113
|
+
if resp.success?
|
114
|
+
logger.info message if logger
|
115
|
+
else
|
106
116
|
logger.warn message if logger
|
107
117
|
raise RequestError.new message if raise_on_fail?
|
108
|
-
else
|
109
|
-
logger.info message if logger
|
110
118
|
end
|
111
119
|
|
112
120
|
resp
|
@@ -118,11 +126,8 @@ module BrocadeVRouter
|
|
118
126
|
|
119
127
|
def build_paths(paths, &blk)
|
120
128
|
paths = Array(paths)
|
121
|
-
|
122
|
-
|
123
|
-
else
|
124
|
-
paths
|
125
|
-
end
|
129
|
+
return paths unless block_given?
|
130
|
+
paths.map { |p| PathBuilder.new(@context, p, &blk).to_a }.flatten
|
126
131
|
end
|
127
132
|
end
|
128
133
|
end
|