knife-zero 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e39c13ccfb06700b75faf777b099918ce95faacd
4
- data.tar.gz: a944aa77a0e4642586f929510ce70c59b765a1a4
3
+ metadata.gz: d3c54264c03d55412eecd072c0b7383b12f8bead
4
+ data.tar.gz: f392fdc368ee1035a433e59a2166e586523c6630
5
5
  SHA512:
6
- metadata.gz: db8c52fa6822403387d8cd0c4529eb0977a908b4c691ca8c41a62c35f567d5237e938b0407721cc9a4dadcf04230a106912ccf73aa6ec9bc25191abbc432ba8f
7
- data.tar.gz: 6ede3e035a21562fe1b3730053f6e18397628ebf52f647896ef107cc687e7c46d3c822b8fd321db8c188a57fa035dda05f589a37f8efe02c7d2ff937d8b767ae
6
+ metadata.gz: f96d14bcb72c719a9cf1f0dea34784b828424779425568902edda23e724dd680abad35226c858443d17e34372bc5c45d5397d4e72882c755934d10d4282ca8ec
7
+ data.tar.gz: 28cf727c4bf98d683f3661cec5e3e5df92b75c8001b16d746b341d0ea708c1f3af618a5349494bf0d1964222a889be9bfa41fa03e4deae01575e338fbe1402a6
@@ -1,55 +1,19 @@
1
1
  require 'chef/knife'
2
- require 'chef/knife/zero_base'
3
- require 'knife-zero/bootstrap_ssh'
2
+ require 'chef/knife/zero_converge'
4
3
 
5
4
  class Chef
6
5
  class Knife
7
- class ZeroChefClient < Chef::Knife::BootstrapSsh
8
- include Chef::Knife::ZeroBase
6
+ class ZeroChefClient < Chef::Knife::ZeroConverge
9
7
  deps do
10
- require 'chef/run_list/run_list_item'
11
- Chef::Knife::BootstrapSsh.load_deps
12
- require "knife-zero/helper"
8
+ Chef::Knife::ZeroConverge.load_deps
13
9
  end
14
10
 
15
11
  banner "knife zero chef_client QUERY (options) | It's same as converge"
12
+ self.options = ZeroConverge.options
16
13
 
17
- self.options = Ssh.options.merge(self.options)
18
- self.options[:use_sudo_password] = Bootstrap.options[:use_sudo_password]
19
-
20
-
21
- option :use_sudo,
22
- :long => "--[no-]sudo",
23
- :description => "Execute the chef-client via sudo (true by default)",
24
- :boolean => true,
25
- :default => true,
26
- :proc => lambda { |v| Chef::Config[:knife][:use_sudo] = v }
27
-
28
-
29
- option :override_runlist,
30
- :short => "-o RunlistItem,RunlistItem...",
31
- :long => "--override-runlist RunlistItem,RunlistItem...",
32
- :description => "Replace current run list with specified items for a single run. It skips save node.json on local",
33
- :default => nil,
34
- :proc => lambda { |o| o.to_s }
35
-
36
-
37
- def initialize(argv=[])
14
+ def run
15
+ Chef::Log.warn "`zero chef_client` was renamed. use `zero converge`."
38
16
  super
39
- self.configure_chef
40
- @name_args = [@name_args[0], start_chef_client]
41
- end
42
-
43
- def start_chef_client
44
- client_path = @config[:use_sudo] || Chef::Config[:knife][:use_sudo] ? 'sudo ' : ''
45
- client_path = @config[:chef_client_path] ? "#{client_path}#{@config[:chef_client_path]}" : "#{client_path}chef-client"
46
- s = "#{client_path}"
47
- s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
48
- s << " -S http://127.0.0.1:#{::Knife::Zero::Helper.zero_remote_port}"
49
- s << " -o #{@config[:override_runlist]}" if @config[:override_runlist]
50
- s << " -W" if @config[:why_run]
51
- Chef::Log.info "Remote command: " + s
52
- s
53
17
  end
54
18
  end
55
19
  end
@@ -1,15 +1,56 @@
1
1
  require 'chef/knife'
2
- require 'chef/knife/zero_chef_client'
2
+ require 'chef/knife/zero_base'
3
+ require 'knife-zero/bootstrap_ssh'
3
4
 
4
5
  class Chef
5
6
  class Knife
6
- class ZeroConverge < Chef::Knife::ZeroChefClient
7
+ class ZeroConverge < Chef::Knife::BootstrapSsh
8
+ include Chef::Knife::ZeroBase
7
9
  deps do
8
- Chef::Knife::ZeroChefClient.load_deps
10
+ require 'chef/run_list/run_list_item'
11
+ Chef::Knife::BootstrapSsh.load_deps
12
+ require "knife-zero/helper"
9
13
  end
10
14
 
11
15
  banner "knife zero converge QUERY (options)"
12
- self.options = ZeroChefClient.options
16
+
17
+ self.options = Ssh.options.merge(self.options)
18
+ self.options[:use_sudo_password] = Bootstrap.options[:use_sudo_password]
19
+
20
+
21
+ option :use_sudo,
22
+ :long => "--[no-]sudo",
23
+ :description => "Execute the chef-client via sudo (true by default)",
24
+ :boolean => true,
25
+ :default => true,
26
+ :proc => lambda { |v| Chef::Config[:knife][:use_sudo] = v }
27
+
28
+
29
+ option :override_runlist,
30
+ :short => "-o RunlistItem,RunlistItem...",
31
+ :long => "--override-runlist RunlistItem,RunlistItem...",
32
+ :description => "Replace current run list with specified items for a single run. It skips save node.json on local",
33
+ :default => nil,
34
+ :proc => lambda { |o| o.to_s }
35
+
36
+
37
+ def initialize(argv=[])
38
+ super
39
+ self.configure_chef
40
+ @name_args = [@name_args[0], start_chef_client]
41
+ end
42
+
43
+ def start_chef_client
44
+ client_path = @config[:use_sudo] || Chef::Config[:knife][:use_sudo] ? 'sudo ' : ''
45
+ client_path = @config[:chef_client_path] ? "#{client_path}#{@config[:chef_client_path]}" : "#{client_path}chef-client"
46
+ s = "#{client_path}"
47
+ s << ' -l debug' if @config[:verbosity] and @config[:verbosity] >= 2
48
+ s << " -S http://127.0.0.1:#{::Knife::Zero::Helper.zero_remote_port}"
49
+ s << " -o #{@config[:override_runlist]}" if @config[:override_runlist]
50
+ s << " -W" if @config[:why_run]
51
+ Chef::Log.info "Remote command: " + s
52
+ s
53
+ end
13
54
  end
14
55
  end
15
56
  end
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = "1.8.1"
3
+ VERSION = "1.8.2"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
@@ -2,6 +2,6 @@ require "knife-zero/version"
2
2
 
3
3
  class TC_Version < Test::Unit::TestCase
4
4
  test "returns version correctly" do
5
- assert_equal("1.8.0", Knife::Zero::VERSION)
5
+ assert_equal("1.8.2", Knife::Zero::VERSION)
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler