ansible_tower_client 0.3.1 → 0.3.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: b661aecf7507f1da64436cf67b61e4e0206d3faf
4
- data.tar.gz: 8fc70dd89e847c5b3eecf1fb3b6736febaf17b44
3
+ metadata.gz: 0b7412f37ec22ef0f3d434b8fdca3b81dd59b0a1
4
+ data.tar.gz: 3a76b2dc55d706299a17adebb015d390bdc1883b
5
5
  SHA512:
6
- metadata.gz: fa62982d8a026f9d2248b35d8f641a2ae7a3c2c1f7997e1c709f49045f94afa02abc00098c1c5cbf2f43646961469d33e1bc3447684797944a02dd27d4f7a932
7
- data.tar.gz: 48b856bc2f414f00ede7102ed6265970fc465a6154119702494db0a2c4eecd2e33c31302865667059160246490b6a174fdd218ac04dce8f72cb77b96fcce022e
6
+ metadata.gz: 4ab66b74f2346f3dfaffdc6c07392b7b9ac80c005c671a629a5487f09ca7bb0bb53864d281d482a4ca5a4fc52a1b348e431ec59f56d78027fe32c4d5f7759fb9
7
+ data.tar.gz: 415d627fbbec11c8a3abc2d97c6b7e0f8f7709ed9e6acfb7682f5d312722aa10e4b8c8b06ef171c89f16d8563a8066c6815a1a0713d64bc406ac6258c2e036db
@@ -1,5 +1,6 @@
1
1
  require "json"
2
2
  require "yaml"
3
+ require "ansible_tower_client/exception"
3
4
  require "ansible_tower_client/logging"
4
5
  require "ansible_tower_client/null_logger"
5
6
  require "ansible_tower_client/version"
@@ -39,6 +39,12 @@ module AnsibleTowerClient
39
39
 
40
40
  def method_missing(method_name, *args, &block)
41
41
  instance.respond_to?(method_name) ? instance.send(method_name, *args, &block) : super
42
+ rescue Faraday::ConnectionFailed, Faraday::SSLError => err
43
+ raise
44
+ rescue Faraday::ClientError => err
45
+ message = JSON.parse(err.message)['detail'] rescue nil
46
+ message ||= "An unknown error was returned from the provider"
47
+ raise AnsibleTowerClient::ConnectionError, message
42
48
  end
43
49
 
44
50
  def respond_to_missing?(method, _include_private = false)
@@ -0,0 +1,3 @@
1
+ module AnsibleTowerClient
2
+ class ConnectionError < Exception; end
3
+ end
@@ -1,3 +1,3 @@
1
1
  module AnsibleTowerClient
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ansible_tower_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dunne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-07-22 00:00:00.000000000 Z
12
+ date: 2016-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -161,6 +161,7 @@ files:
161
161
  - lib/ansible_tower_client/base_model.rb
162
162
  - lib/ansible_tower_client/collection.rb
163
163
  - lib/ansible_tower_client/connection.rb
164
+ - lib/ansible_tower_client/exception.rb
164
165
  - lib/ansible_tower_client/group.rb
165
166
  - lib/ansible_tower_client/hash_model.rb
166
167
  - lib/ansible_tower_client/host.rb