knife-sharp 0.4.2 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +5 -1
- data/lib/chef/knife/sharp-align.rb +16 -1
- data/lib/knife-sharp.rb +1 -1
- metadata +15 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f1a5548924fee079df802660b4e9a9d1980386db
|
4
|
+
data.tar.gz: c6f27200d24340b77a27570c95e73ee10c106d94
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 556242f0e8727b7e9bdbe5384265b2f3f12fcef57756cf978ae5de787b8a1ff4cf69ebadab5fa737d918d5748da5935765a4bacbe3852e04f77de08cedaa6ca0
|
7
|
+
data.tar.gz: 16ac33df09b42e16d5796bf63e1d88a3093c67f48e5d75c2e9e7940c7afc64f8c310b635e385c280b3ab8c09e52a7b19b3d8be7e240364cc28e2f4f52239f6dc
|
data/README.md
CHANGED
@@ -27,6 +27,8 @@ module KnifeSharp
|
|
27
27
|
:default => false
|
28
28
|
|
29
29
|
deps do
|
30
|
+
require 'chef/environment'
|
31
|
+
require 'chef/role'
|
30
32
|
require 'chef/cookbook/metadata'
|
31
33
|
require 'chef/cookbook_loader'
|
32
34
|
require 'chef/cookbook_uploader'
|
@@ -136,7 +138,7 @@ module KnifeSharp
|
|
136
138
|
ui.msg(ui.color("== Cookbooks ==", :bold))
|
137
139
|
|
138
140
|
updated_versions = Hash.new
|
139
|
-
local_versions = Hash[Dir.glob("#{@cb_path}/*").map {|cb| [File.basename(cb), @loader[File.basename(cb)].version] }]
|
141
|
+
local_versions = Hash[Dir.glob("#{@cb_path}/*").select {|cb| File.directory?(cb)}.map {|cb| [File.basename(cb), @loader[File.basename(cb)].version] }]
|
140
142
|
remote_versions = Chef::Environment.load(@environment).cookbook_versions.each_value {|v| v.gsub!("= ", "")}
|
141
143
|
|
142
144
|
if local_versions.empty?
|
@@ -301,6 +303,7 @@ module KnifeSharp
|
|
301
303
|
if !updated_dbs.empty?
|
302
304
|
all = false
|
303
305
|
updated_dbs.each do |name, obj|
|
306
|
+
answer = nil
|
304
307
|
answer = ui.ask_question("> Update #{name.join("/")} data bag item on server ? Y/N/(A)ll/(Q)uit ", :default => "N").upcase unless all
|
305
308
|
|
306
309
|
if answer == "A"
|
@@ -322,9 +325,20 @@ module KnifeSharp
|
|
322
325
|
end
|
323
326
|
|
324
327
|
def update_databags
|
328
|
+
parent_databags = Chef::DataBag.list.keys
|
325
329
|
unless @databags.empty?
|
326
330
|
@databags.each do |name, obj|
|
327
331
|
begin
|
332
|
+
# create the parent if needed
|
333
|
+
unless parent_databags.include?(name.first)
|
334
|
+
db = Chef::DataBag.new
|
335
|
+
db.name(name.first)
|
336
|
+
db.create
|
337
|
+
# add it to the list to avoid trying to recreate it
|
338
|
+
parent_databags.push(name.first)
|
339
|
+
ui.msg("* Creating data bag #{name.first}")
|
340
|
+
log_action("creating data bag #{name.first}")
|
341
|
+
end
|
328
342
|
db = Chef::DataBagItem.new
|
329
343
|
db.data_bag(name.first)
|
330
344
|
db.raw_data = obj
|
@@ -483,4 +497,5 @@ module KnifeSharp
|
|
483
497
|
end
|
484
498
|
end
|
485
499
|
end
|
500
|
+
|
486
501
|
end
|
data/lib/knife-sharp.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-sharp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nicolas Szalay
|
@@ -10,38 +9,34 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: chef
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - ">="
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: 10.14.0
|
23
21
|
type: :runtime
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - ">="
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: 10.14.0
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: grit
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- - ~>
|
32
|
+
- - "~>"
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: 2.5.0
|
39
35
|
type: :runtime
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- - ~>
|
39
|
+
- - "~>"
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: 2.5.0
|
47
42
|
description: Sharpen your knife
|
@@ -54,34 +49,34 @@ extra_rdoc_files: []
|
|
54
49
|
files:
|
55
50
|
- README.md
|
56
51
|
- ext/sharp-config.yml
|
57
|
-
- lib/knife-sharp.rb
|
58
52
|
- lib/chef/knife/sharp-align.rb
|
59
53
|
- lib/chef/knife/sharp-backup.rb
|
60
54
|
- lib/chef/knife/sharp-history.rb
|
61
|
-
- lib/chef/knife/sharp-server.rb
|
62
55
|
- lib/chef/knife/sharp-rollback.rb
|
56
|
+
- lib/chef/knife/sharp-server.rb
|
57
|
+
- lib/knife-sharp.rb
|
63
58
|
homepage: https://github.com/Fotolia/knife-sharp
|
64
|
-
licenses:
|
59
|
+
licenses:
|
60
|
+
- 3-BSD
|
61
|
+
metadata: {}
|
65
62
|
post_install_message:
|
66
63
|
rdoc_options: []
|
67
64
|
require_paths:
|
68
65
|
- lib
|
69
66
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
67
|
requirements:
|
72
|
-
- -
|
68
|
+
- - ">="
|
73
69
|
- !ruby/object:Gem::Version
|
74
70
|
version: '0'
|
75
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
72
|
requirements:
|
78
|
-
- -
|
73
|
+
- - ">="
|
79
74
|
- !ruby/object:Gem::Version
|
80
75
|
version: '0'
|
81
76
|
requirements: []
|
82
77
|
rubyforge_project:
|
83
|
-
rubygems_version:
|
78
|
+
rubygems_version: 2.2.0
|
84
79
|
signing_key:
|
85
|
-
specification_version:
|
80
|
+
specification_version: 4
|
86
81
|
summary: Knife sharp plugin
|
87
82
|
test_files: []
|