proxmox-rb 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proxmox-rb/auth.rb +3 -3
- data/proxmox-rb.gemspec +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: 57995cd1309fa15df3dfab430fc115b1f1a5765c
|
4
|
+
data.tar.gz: b92b350d5aead9f87dfd65582a6b7e0556272fd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c6396f21c721a1ab6659940dd5d2d33334fac4c14f25d747efccc38a78544cf71465c2469e0352695ca71d52e53747e10c7ee87a375880b5e1c09d3bdddeb8
|
7
|
+
data.tar.gz: 1ec2fecc84de2266f5a9b2f8cc5ebb62506738337c8d7615879835cdafc8eee5e7d9fe741e99c6121535cd05dcab795d68a41072351c294288aa18977e93565e
|
data/lib/proxmox-rb/auth.rb
CHANGED
@@ -2,14 +2,14 @@ module ProxmoxRb
|
|
2
2
|
class Auth
|
3
3
|
Ticket = Struct.new(:host, :ticket, :csrf)
|
4
4
|
def self.get_ticket(host, username, password)
|
5
|
+
retry_count = 0
|
5
6
|
auth = nil
|
6
7
|
begin
|
7
8
|
auth = JSON.parse(RestClient.post 'https://' + host + ':8006/api2/json/access/ticket',
|
8
9
|
{ username: username, password: password })
|
9
10
|
rescue => e
|
10
|
-
|
11
|
-
|
12
|
-
retry
|
11
|
+
sleep_count += 1
|
12
|
+
retry if sleep_count < 5
|
13
13
|
end
|
14
14
|
ticket = auth['data']['ticket']
|
15
15
|
csrf = auth['data']['CSRFPreventionToken']
|
data/proxmox-rb.gemspec
CHANGED