knife-push 1.1.5 → 2.0.0

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: 388b9c9ebbbc83270b7329c93b7d57b1fa5c03649f05f6f84cada273e0c56a58
4
- data.tar.gz: 242ffdba74fb0d386fb0388f7697b1664b049631d70c2d670bf45e793805237b
3
+ metadata.gz: 636e6fa1d65f445cf9f4981f3d75b857854b756f507468f6950a4234e3b6f980
4
+ data.tar.gz: 11b1c0bbec31bb8a6e69469cafd3d385458d3f3f8f21e42b9afae6bd673c971f
5
5
  SHA512:
6
- metadata.gz: 6a7a37b6b8efdaf066d6829a905d719b921a4298a1bd2f083fd018000bd3a19a3a480d750218cbeea0a0dc45c7bad766f03624ab6b01d1886ee3a483702485fe
7
- data.tar.gz: 8ba046a4b3e3de9658286eac24a31804502d4e08e7d7438df860cfccdd53dbe7e1e74af4c0729e5c6c96bd0fa351168cb2534a2e6ed9bac37d0de6ffb0bb7e78
6
+ metadata.gz: 4ed039e98ff4e483ac41f03c2f17b7b58e344236d1e92954e3850ca947fef6a48c3333cb10cc75f7dad56868d27010f2a41439542160a3d4682011fb63844601
7
+ data.tar.gz: 25f6b27f874f515b06857c57c450652c824a6471dcba8114c9a92255e9eeffd591c935a5b7d2d026edb22090a2bd52dbaa804d766a382fd10120dfdac1f252ba
@@ -15,6 +15,8 @@
15
15
  # under the License.
16
16
  #
17
17
 
18
+ require "addressable/uri"
19
+
18
20
  class Chef
19
21
  class Knife
20
22
  module JobHelpers
@@ -22,11 +24,10 @@ class Chef
22
24
  node_names = []
23
25
  if search
24
26
  q = Chef::Search::Query.new
25
- escaped_query = URI.escape(search,
26
- Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
27
+ escaped_query = Addressable::URI.encode_component(search, Addressable::URI::CharacterClasses::QUERY)
27
28
  begin
28
29
  nodes = q.search(:node, escaped_query).first
29
- rescue Net::HTTPServerException => e
30
+ rescue Net::HTTPClientException => e
30
31
  msg Chef::JSONCompat.from_json(e.response.body)["error"].first
31
32
  ui.error("knife search failed: #{msg}")
32
33
  exit 1
@@ -39,16 +39,10 @@ class Chef
39
39
 
40
40
  def get_channel(channel)
41
41
  channel ||= "stdout"
42
- case channel
43
- when "stdout"
44
- return channel
45
- when "stderr"
46
- return channel
47
- else
48
- raise "Invalid Format please enter stdout or stderr"
49
- end
50
- end
42
+ return channel if channel == "stdout" || channel == "stderr"
51
43
 
44
+ raise "Invalid Format please enter stdout or stderr"
45
+ end
52
46
  end
53
47
  end
54
48
  end
@@ -113,7 +113,7 @@ class Chef
113
113
 
114
114
  begin
115
115
  job = run_helper(config, v2_json)
116
- rescue Net::HTTPServerException => e
116
+ rescue Net::HTTPClientException => e
117
117
  raise e if e.response.code != "400"
118
118
 
119
119
  ui.warn "Falling back to Push Jobs v1 mode."
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Knife
3
3
  module Push
4
- VERSION = "1.1.5".freeze
4
+ VERSION = "2.0.0".freeze
5
5
  MAJOR, MINOR, TINY = VERSION.split(".")
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-push
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '13.0'
19
+ version: '15.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '13.0'
26
+ version: '15.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: addressable
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  description: Knife plugin for Chef Push Jobs
28
42
  email: jkeiser@chef.io
29
43
  executables: []
@@ -50,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - ">="
52
66
  - !ruby/object:Gem::Version
53
- version: 2.2.2
67
+ version: '2.5'
54
68
  required_rubygems_version: !ruby/object:Gem::Requirement
55
69
  requirements:
56
70
  - - ">="