knife-zero 1.9.0 → 1.9.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: fb08a77c75ed412f73232982758664c56edcc320
4
- data.tar.gz: 972d0b53f360020d722945ff15d98c567b5bb0f1
3
+ metadata.gz: 22e6e86fa94daaa9c448d457064d019fce563dd6
4
+ data.tar.gz: 3c5b8f78180ce1cf06fd1376f45c5a4bc0e06a7f
5
5
  SHA512:
6
- metadata.gz: c279163703ea39020514a90ee8ea9d961ea149030fa81a2b9c8208ea189e49967c7c3f9dc2edc989f13b4c369d3df6a978fd50f2900416777d8e0056b126903e
7
- data.tar.gz: 26dc030e5c3829d6d67d0a17505dd269e0c6a4c0e42864dd42e5e690bb6bf9936ecb3ebcb70ee7e5619bb0171984fe8b2fbbaaa57d7150cd5c58acb8a7f565dc
6
+ metadata.gz: 5e0dc596b82124a4a478ec81f45a4a24e79cffe04422ce0b1f2e1c2a23c4c3b6c91cd28c9296b53c0f52795655333fc2d338b43fabb5534b660c190e5b663977
7
+ data.tar.gz: 51ddf8d0e3e4b33104f7593f9b1dcefba73481f84e691238c4c2fbf16e5feae1151c72af48b800399d7694f55aa367afdc6e5355c34b471a413fa692db8afd49
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## v1.9.2
6
+
7
+ - Monkey: include Fixed host parsing to work with ipv6 addresses net-ssh/net-ssh-multi#9
8
+ - https://github.com/net-ssh/net-ssh-multi/pull/9
9
+
10
+ ## v1.9.1
11
+
12
+ - Compatibility: Keep same behavior of --json-attribute-file option.
13
+ - use patche only before 12.5.2
14
+
5
15
  ## v1.9.0
6
16
 
7
17
  - Change: use nil to ssh_user on bootstraping by default.
@@ -31,32 +31,45 @@ class Chef
31
31
  :default => true,
32
32
  :proc => lambda { |v| Chef::Config[:knife][:bootstrap_converge] = v }
33
33
 
34
- ## monkey for #3900 >>
35
- unless options.has_key?(:first_boot_attributes_from_file)
36
- option :first_boot_attributes_from_file,
37
- :long => "--json-attribute-file FILE",
38
- :description => "A JSON file to be used to the first run of chef-client",
39
- :proc => lambda { |o| Chef::JSONCompat.parse(File.read(o)) },
40
- :default => nil
34
+ ## monkey for #3900(included 12.5.2) >>
35
+ if Gem::Version.new(Chef::VERSION) < Gem::Version.new('12.5.2')
36
+ unless options.has_key?(:first_boot_attributes_from_file)
37
+ option :first_boot_attributes_from_file,
38
+ :long => "--json-attribute-file FILE",
39
+ :description => "A JSON file to be used to the first run of chef-client",
40
+ :proc => lambda { |o| Chef::JSONCompat.parse(File.read(o)) },
41
+ :default => nil
41
42
 
42
- def render_template
43
- @config[:first_boot_attributes].merge!(@config[:first_boot_attributes_from_file]) if @config[:first_boot_attributes_from_file]
44
- super
43
+ def first_boot_attributes
44
+ @config[:first_boot_attributes] || @config[:first_boot_attributes_from_file] || {}
45
+ end
46
+
47
+ def render_template
48
+ @config[:first_boot_attributes] = first_boot_attributes
49
+ template_file = find_template
50
+ template = IO.read(template_file).chomp
51
+ Erubis::Eruby.new(template).evaluate(bootstrap_context)
52
+ end
53
+
54
+ ## monkey for #3900(included 12.5.2) <<
45
55
  end
46
- ## monkey for #3900 <<
47
56
  end
48
57
 
49
58
  def run
50
- ## monkey for #3900 >>
51
- if @config[:first_boot_attributes].any? && @config[:first_boot_attributes_from_file]
52
- raise "You cannot pass both --json-attributes and --json-attribute-file."
59
+ ## monkey for #3900(included 12.5.2) >>
60
+ if Gem::Version.new(Chef::VERSION) < Gem::Version.new('12.5.2')
61
+ if @config[:first_boot_attributes] # Check for edge master
62
+ if @config[:first_boot_attributes].any? && @config[:first_boot_attributes_from_file]
63
+ raise "You cannot pass both --json-attributes and --json-attribute-file."
64
+ end
65
+ end
53
66
  end
54
- ## monkey for #3900 <<
67
+ ## monkey for #3900(included 12.5.2) <<
55
68
 
56
69
  if @config[:first_boot_attributes_from_file]
57
70
  @config[:first_boot_attributes_from_file] = @config[:first_boot_attributes_from_file].merge(build_knifezero_attributes_for_node)
58
71
  else
59
- @config[:first_boot_attributes] = @config[:first_boot_attributes].merge(build_knifezero_attributes_for_node)
72
+ @config[:first_boot_attributes] = build_knifezero_attributes_for_node
60
73
  end
61
74
  super
62
75
  end
@@ -28,4 +28,30 @@ if Net::SSH::Multi::Version::STRING == "1.1.0" || Net::SSH::Multi::Version::STRI
28
28
  end
29
29
  end
30
30
  end
31
+
32
+ # https://github.com/net-ssh/net-ssh-multi/pull/9
33
+ require 'net/ssh/multi/server'
34
+ module Net::SSH::Multi
35
+ class Server
36
+ class_eval do
37
+ def initialize(master, host, options={})
38
+ @master = master
39
+ @options = options.dup
40
+
41
+ ## Patched line here
42
+ @user, @host, port = host.match(/^(?:([^;,:=]+)@|)\[?(.*?)\]?(?::(\d+)|)$/)[1,3]
43
+
44
+ user_opt, port_opt = @options.delete(:user), @options.delete(:port)
45
+
46
+ @user = @user || user_opt || master.default_user
47
+ port ||= port_opt
48
+
49
+ @options[:port] = port.to_i if port
50
+
51
+ @gateway = @options.delete(:via)
52
+ @failed = false
53
+ end
54
+ end
55
+ end
56
+ end
31
57
  end
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Zero
3
- VERSION = "1.9.0"
3
+ VERSION = "1.9.2"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  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.9.0
4
+ version: 1.9.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-10-09 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler