ansible_tower_client 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -10
- data/ansible_tower_client.gemspec +1 -1
- data/lib/ansible_tower_client/api.rb +16 -2
- data/lib/ansible_tower_client/null_logger.rb +4 -0
- data/lib/ansible_tower_client/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b2dc19710dcd49dc3f01afcb0c098c05b493ada
|
4
|
+
data.tar.gz: 2b4c93dc99dd27fe22da7772d84f4b525705a575
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f83694a37572b9605ef8c8ab3427beac58c12d568c4d535dbe1b751b18a4206a9f3912b6ade318ed6b2ac0e0e6dbebc1d3a7d95bdeec613cb160c5d5467c1d4
|
7
|
+
data.tar.gz: 36e5f3499c43259246444b49f65a8b89328c6f811c54c0303ccf85d097692da1841252c0a2fa8e4a2c1ea6f579e111e586745c5f90cc3627671e34ec6fb48685
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# AnsibleTowerClient
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ansible_tower_client.svg)](http://badge.fury.io/rb/ansible_tower_client)
|
4
|
-
[![Build Status](https://travis-ci.org/
|
5
|
-
[![Code Climate](https://codeclimate.com/github/
|
6
|
-
[![Dependency Status](https://gemnasium.com/
|
7
|
-
[![Coverage Status](http://img.shields.io/coveralls/
|
8
|
-
[![Security](https://hakiri.io/github/
|
4
|
+
[![Build Status](https://travis-ci.org/ansible/ansible_tower_client_ruby.svg)](https://travis-ci.org/ansible/ansible_tower_client_ruby)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/ansible/ansible_tower_client_ruby/badges/gpa.svg)](https://codeclimate.com/github/ansible/ansible_tower_client_ruby)
|
6
|
+
[![Dependency Status](https://gemnasium.com/ansible/ansible_tower_client_ruby.svg)](https://gemnasium.com/ansible/ansible_tower_client_ruby)
|
7
|
+
[![Coverage Status](http://img.shields.io/coveralls/ansible/ansible_tower_client_ruby.svg)](https://coveralls.io/r/ansible/ansible_tower_client_ruby)
|
8
|
+
[![Security](https://hakiri.io/github/ansible/ansible_tower_client_ruby/master.svg)](https://hakiri.io/github/ansible/ansible_tower_client_ruby/master)
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
@@ -23,10 +23,6 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
$ gem install ansible_tower_client
|
25
25
|
|
26
|
-
## Usage
|
27
|
-
|
28
|
-
TODO: Write usage instructions here
|
29
|
-
|
30
26
|
## Development
|
31
27
|
|
32
28
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -35,7 +31,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
35
31
|
|
36
32
|
## Contributing
|
37
33
|
|
38
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
34
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Ansible/ansible_tower_client_ruby.
|
39
35
|
|
40
36
|
## License
|
41
37
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{Ansible Tower REST API wrapper gem}
|
13
13
|
spec.description = %q{Ansible Tower REST API wrapper gem}
|
14
|
-
spec.homepage = "https://github.com/
|
14
|
+
spec.homepage = "https://github.com/Ansible/ansible_tower_client_ruby"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -1,5 +1,9 @@
|
|
1
|
+
require 'pp'
|
2
|
+
|
1
3
|
module AnsibleTowerClient
|
2
4
|
class Api < Connection
|
5
|
+
include Logging
|
6
|
+
|
3
7
|
attr_reader :instance
|
4
8
|
def initialize(connection)
|
5
9
|
@instance = connection
|
@@ -50,12 +54,22 @@ module AnsibleTowerClient
|
|
50
54
|
end
|
51
55
|
|
52
56
|
def method_missing(method_name, *args, &block)
|
53
|
-
instance.respond_to?(method_name)
|
57
|
+
if instance.respond_to?(method_name)
|
58
|
+
logger.debug { "#{self.class.name} Sending <#{method_name}> with <#{args.inspect}>" }
|
59
|
+
instance.send(method_name, *args, &block).tap do |response|
|
60
|
+
logger.debug { "#{self.class.name} Response:\n#{JSON.parse(response.body).pretty_inspect}" }
|
61
|
+
end
|
62
|
+
else
|
63
|
+
super
|
64
|
+
end
|
54
65
|
rescue Faraday::ConnectionFailed, Faraday::SSLError => err
|
55
66
|
raise
|
56
67
|
rescue Faraday::ClientError => err
|
57
|
-
|
68
|
+
response = err.response
|
69
|
+
logger.debug { "#{self.class.name} #{err.class.name} #{response.pretty_inspect}" }
|
70
|
+
message = JSON.parse(response[:body])['detail'] rescue nil
|
58
71
|
message ||= "An unknown error was returned from the provider"
|
72
|
+
logger.error("#{self.class.name} #{err.class.name} #{message}")
|
59
73
|
raise AnsibleTowerClient::ConnectionError, message
|
60
74
|
end
|
61
75
|
|
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.4.
|
4
|
+
version: 0.4.1
|
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-
|
12
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -175,7 +175,7 @@ files:
|
|
175
175
|
- lib/ansible_tower_client/null_logger.rb
|
176
176
|
- lib/ansible_tower_client/v2/job_template_v2.rb
|
177
177
|
- lib/ansible_tower_client/version.rb
|
178
|
-
homepage: https://github.com/
|
178
|
+
homepage: https://github.com/Ansible/ansible_tower_client_ruby
|
179
179
|
licenses:
|
180
180
|
- MIT
|
181
181
|
metadata: {}
|