manageiq-api-client 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 3ca83700fb1d4b54c43d3291ab55d6c6219bf5618cd2c79fa9c791801e960968
4
- data.tar.gz: 96c96017e33930ba4d55de7f7f2cb327d5ba693bd40a1495c9afbf31ebb4826f
3
+ metadata.gz: 50deacbf04bb1011a36552fe87b330679ead5c049171284b58185cab76eb3b91
4
+ data.tar.gz: 34538f3981ceb4559ae60da6bd7970d8d0e8a62fb61928b7cafe5d91716a256f
5
5
  SHA512:
6
- metadata.gz: fbaa770ff5d0e944d1b9f8cfbb1875a4b02564650bf9382d3431881fffe28b80c2bd9cc2700db09e17eb9093b1a6642091d666cad07a491e74da2abb90609846
7
- data.tar.gz: '08a8a0892373c931c21704fc8a0492b261c9e24bdc3a84791bb1ff6109518933a49c834d8153fbbf88566af9acd3273055b55a1ad21fe797f6b3126549aa862d'
6
+ metadata.gz: ac7e70a1f2cb256b63a88ef008f9209e29de360262ed36e655121c11d2efd58ce2fc4e351bb8889724405650f38e0c7345f093c6455532b0afa3602370957196
7
+ data.tar.gz: 7e78e7028b71d80f4acf116aed2a3996a4106d1eed3bc7ca5288ab617d3f24152258b4ed8a0805a4a9bf246bc8ad01416b77ee8854bf4dc357cbf65b8d0ed067
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.1] - 2018-08-06
10
+
11
+ ### Fixed
12
+ - Raise a more specific error class [[#82](https://github.com/ManageIQ/manageiq-api-client/pull/82)]
13
+
9
14
  ## [0.3.0] - 2018-03-14
10
15
 
11
16
  ### Changed
@@ -34,7 +39,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
34
39
  - Add CHANGELOG.md
35
40
  - Update README with simple instructions reflecting the query interface.
36
41
 
37
- [Unreleased]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.3.0...HEAD
42
+ [Unreleased]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.3.1...HEAD
43
+ [0.3.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.3.0...v0.3.1
38
44
  [0.3.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.2.0...v0.3.0
39
45
  [0.2.0]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.1...v0.2.0
40
46
  [0.1.1]: https://github.com/ManageIQ/manageiq-api-client/compare/v0.1.0...v0.1.1
@@ -8,6 +8,7 @@ require "pp"
8
8
  require "query_relation"
9
9
 
10
10
  require "manageiq/api/client/client"
11
+ require "manageiq/api/client/exceptions"
11
12
  require "manageiq/api/client/mixins/action_mixin"
12
13
  require "manageiq/api/client/mixins/custom_inspect_mixin"
13
14
 
@@ -39,9 +39,12 @@ module ManageIQ
39
39
  when 0
40
40
  raise "Couldn't find resource without an 'id'"
41
41
  when 1
42
- res = limit(1).where(:id => args[0]).to_a
43
- raise "Couldn't find resource with 'id' #{args}" if res.blank?
44
- request_array ? res : res.first
42
+ begin
43
+ res = limit(1).where(:id => args[0]).to_a
44
+ request_array ? res : res.first
45
+ rescue => err
46
+ raise ManageIQ::API::Client::ResourceNotFound, "Couldn't find resource with 'id' #{args}"
47
+ end
45
48
  else
46
49
  raise "Multiple resource find is not supported" unless respond_to?(:query)
47
50
  query(args.collect { |id| { "id" => id } })
@@ -0,0 +1,8 @@
1
+ module ManageIQ
2
+ module API
3
+ class Client
4
+ class Exception < ::RuntimeError; end
5
+ class ResourceNotFound < ManageIQ::API::Client::Exception; end
6
+ end
7
+ end
8
+ end
@@ -1,7 +1,7 @@
1
1
  module ManageIQ
2
2
  module API
3
3
  class Client
4
- VERSION = "0.3.0".freeze
4
+ VERSION = "0.3.1".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alberto Bellotti
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-14 00:00:00.000000000 Z
12
+ date: 2018-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -175,6 +175,7 @@ files:
175
175
  - lib/manageiq/api/client/collection_options.rb
176
176
  - lib/manageiq/api/client/connection.rb
177
177
  - lib/manageiq/api/client/error.rb
178
+ - lib/manageiq/api/client/exceptions.rb
178
179
  - lib/manageiq/api/client/identity.rb
179
180
  - lib/manageiq/api/client/mixins/action_mixin.rb
180
181
  - lib/manageiq/api/client/mixins/custom_inspect_mixin.rb
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
206
  version: '0'
206
207
  requirements: []
207
208
  rubyforge_project:
208
- rubygems_version: 2.7.6
209
+ rubygems_version: 2.7.7
209
210
  signing_key:
210
211
  specification_version: 4
211
212
  summary: ManageIQ API Client