kitchen-digitalocean 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a7045fdb60287943a239cf741000833fb00721a
4
- data.tar.gz: 871aea1076042ce89a526cd395c261d37ac48776
3
+ metadata.gz: 3b26c70cbb36054e0deb86e0ba3db0a81263d29e
4
+ data.tar.gz: 642e28fb1b3f672894712e414a3ea8299bf840c7
5
5
  SHA512:
6
- metadata.gz: 15d6ebccf19a6397fe2a04cc4fb55af85415644685c2f2c971c052a2bc20d44a2a3357a54ffda8fc3964290557f02dee35514066bc999613d0a5d8a97762abbb
7
- data.tar.gz: e26cd240b32e1be3c9bdc36a37a66973ebc1d0b934a425382e15d217e674773ca6a643f07860f5330ece17fe7f24c5a47ea0cde8a20501c831b7e8c5bdd6ac8b
6
+ metadata.gz: dc5eb860a74e2fbb1c9182bc8c21b081b05f395cf440ef5c3088b5a882f884819d1ecc33fd35e56e1448de7121def2cdca05a9c594c8921c93ada2be5776c6a7
7
+ data.tar.gz: e5813b695d6769ea60f78358f4756b464477e083838c26da500ad717dc24161bc3ee1dc54d1058588485dc3996ab96646bbc5b655b3c71949de13d99d07458b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.8.2 / 2014-11-09
2
+
3
+ * Handle API errors more gracefully, closes issue #33.
4
+
1
5
  # 0.8.1 / 2014-10-13
2
6
 
3
7
  * [@sarkis](https://github.com/sarkis) [PR #32] fix driver config example
@@ -21,6 +21,7 @@ require 'droplet_kit'
21
21
  require 'kitchen'
22
22
  require 'etc'
23
23
  require 'socket'
24
+ require 'json'
24
25
 
25
26
  module Kitchen
26
27
  module Driver
@@ -50,6 +51,7 @@ module Kitchen
50
51
 
51
52
  def create(state)
52
53
  server = create_server
54
+
53
55
  state[:server_id] = server.id
54
56
 
55
57
  info("Digital Ocean instance <#{state[:server_id]}> created.")
@@ -121,7 +123,14 @@ module Kitchen
121
123
  ipv6: config[:ipv6]
122
124
  )
123
125
 
124
- client.droplets.create(droplet)
126
+ resp = client.droplets.create(droplet)
127
+
128
+ if resp.class != DropletKit::Droplet
129
+ error JSON.parse(resp)['message']
130
+ error "Please check your access token is set correctly."
131
+ else
132
+ resp
133
+ end
125
134
  end
126
135
 
127
136
  def debug_server_config
@@ -19,7 +19,7 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Digital Ocean Kitchen driver
22
- DIGITALOCEAN_VERSION = '0.8.1'
22
+ DIGITALOCEAN_VERSION = '0.8.2'
23
23
  end
24
24
  end
25
25
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Fitzgerald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-14 00:00:00.000000000 Z
11
+ date: 2014-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen