brocade_vrouter 0.1.3 → 0.1.4
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/client.rb +3 -2
- data/lib/brocade_vrouter/configuration.rb +7 -2
- 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: 850f082f5c5d1b675545f8f622287feb75b13c4c
|
4
|
+
data.tar.gz: f69299aa6a4a5f328a1b4406282d00cb0297c9dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b638c3a1a40d2aa5991220ac9cb112affc7f8b4e92a5f8a57aed9f5c711fa5fc90e5abbf1b16885d6e53bf305395a864fee0695b5cd0fdd0c9f9a5f144eb8ddc
|
7
|
+
data.tar.gz: 268157e2b92c1d63f5e9d9d74efbebd8d5e3440fd9fbd8c224ca61d2121d4fe5aba93ad12df39af64dc4803db3d0a65288572e6de82151b34628873d7cf58e86
|
@@ -16,8 +16,9 @@ module BrocadeVRouter
|
|
16
16
|
@logger = logger || config.logger
|
17
17
|
end
|
18
18
|
|
19
|
-
def configuration(&blk)
|
20
|
-
@current_conf ||= Configuration.new connection, logger: logger
|
19
|
+
def configuration(raise_on_fail: nil, &blk)
|
20
|
+
@current_conf ||= Configuration.new connection, logger: logger,
|
21
|
+
raise_on_fail: raise_on_fail.nil? ? BrocadeVRouter.config.raise_on_fail : raise_on_fail
|
21
22
|
block_given? ? @current_conf.perform(&blk) : @current_conf
|
22
23
|
end
|
23
24
|
|
@@ -4,10 +4,11 @@ module BrocadeVRouter
|
|
4
4
|
|
5
5
|
attr_reader :connection, :last_response, :logger
|
6
6
|
|
7
|
-
def initialize(connection, base_path: nil, logger: nil)
|
7
|
+
def initialize(connection, base_path: nil, logger: nil, raise_on_fail: true)
|
8
8
|
@connection = connection
|
9
9
|
@base_path = base_path
|
10
10
|
@logger = logger
|
11
|
+
@raise_on_fail = raise_on_fail
|
11
12
|
end
|
12
13
|
|
13
14
|
def base_path
|
@@ -70,6 +71,10 @@ module BrocadeVRouter
|
|
70
71
|
.fetch('session', [])
|
71
72
|
end
|
72
73
|
|
74
|
+
def raise_on_fail?
|
75
|
+
@raise_on_fail
|
76
|
+
end
|
77
|
+
|
73
78
|
private
|
74
79
|
|
75
80
|
def handle_response(resp)
|
@@ -78,7 +83,7 @@ module BrocadeVRouter
|
|
78
83
|
message = "#{resp.env.method} #{resp.env.url} #{resp.env.status}\n#{resp.body}"
|
79
84
|
logger.info message if logger
|
80
85
|
|
81
|
-
raise RequestError.new message if
|
86
|
+
raise RequestError.new message if raise_on_fail? && !resp.success?
|
82
87
|
|
83
88
|
resp
|
84
89
|
end
|