ocp 0.0.13 → 0.0.14
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/client/OcpClient.rb +9 -18
- 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: 001da620f5d23077105f3e76137004436939c221
|
4
|
+
data.tar.gz: dec33cc652e3f44d4a93619751e50fc0d2696ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347c5491525a5f7498e6eb2670a8fe5f27b8652cf81802a5222d598af7cb3db9ee2753237d59957badcb1a190f41934c857f82f5599f8e7f2cb47a8f1617ca1b
|
7
|
+
data.tar.gz: bad8c5375e8fa09681901831c93d761365ae16292b87fd9e2d06573cd9992276cad3076526702d56c08100da914b7e8737922bc84dacb78c323a10e01d806607
|
data/lib/client/OcpClient.rb
CHANGED
@@ -81,26 +81,22 @@ class OcpClient
|
|
81
81
|
private
|
82
82
|
|
83
83
|
def call(location, body, method)
|
84
|
-
|
85
|
-
if @debug
|
86
|
-
puts "Method - #{method}"
|
87
|
-
unless body.nil?
|
88
|
-
puts "Body - #{JSON.pretty_generate(body)}"
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
84
|
if !@clientcert.nil? and !@clientkey.nil?
|
93
85
|
return callbycert(location, body, method)
|
94
86
|
else
|
95
87
|
return callbytoken(location, body, method)
|
96
88
|
end
|
97
|
-
|
98
89
|
end
|
99
90
|
|
100
91
|
def callbytoken(location, body=nil, method)
|
101
92
|
|
102
93
|
if @debug
|
103
94
|
puts "Client Token - #{@token}"
|
95
|
+
puts "URL - #{@url}#{location}"
|
96
|
+
puts "Method - #{method}"
|
97
|
+
unless body.nil?
|
98
|
+
puts "Body - #{JSON.pretty_generate(body)}"
|
99
|
+
end
|
104
100
|
end
|
105
101
|
|
106
102
|
response = nil
|
@@ -127,9 +123,9 @@ class OcpClient
|
|
127
123
|
end
|
128
124
|
rescue => exception
|
129
125
|
if @debug and !exception.nil?
|
130
|
-
puts "Exception: " << exception
|
126
|
+
puts "Exception: " << exception
|
131
127
|
end
|
132
|
-
@response = exception
|
128
|
+
@response = exception
|
133
129
|
end
|
134
130
|
|
135
131
|
@response = response
|
@@ -180,17 +176,12 @@ class OcpClient
|
|
180
176
|
).execute
|
181
177
|
end
|
182
178
|
rescue => exception
|
183
|
-
puts "----- EXCEPTION #{exception}----"
|
184
179
|
if @debug and !exception.nil?
|
185
|
-
puts "Exception: " << exception
|
180
|
+
puts "Exception: " << exception
|
186
181
|
end
|
187
|
-
@response = exception
|
182
|
+
@response = exception
|
188
183
|
end
|
189
184
|
|
190
|
-
|
191
|
-
|
192
|
-
puts "----- GOT HERE ----"
|
193
|
-
|
194
185
|
@response = response
|
195
186
|
|
196
187
|
if !response.nil? and @pretty
|