knife-depsolver 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -2
- data/lib/chef/knife/depsolver.rb +11 -2
- data/lib/knife-depsolver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2dd2e1ec1022caf3f4fc83c14292241b592240f
|
4
|
+
data.tar.gz: c67dec4e629b5b7395e7b4336aad1d386f4e88ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98bfafbc8cd1d017c7eae71f5662d1058181d388e27118d34518100ad7288249301a4778e51e271cab4f37d3c32934050aaba66728d69cfa52b1e04dc26b12d7
|
7
|
+
data.tar.gz: c3659a8adf16243f9f5a12a314cf2429855a2ff29d0476053a53dc79c69d8ae9b8da86dcfe90cc39a0801baee7648a2d65e6f7c4e84086b1edb6a6850768ba8a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 2.0.3 (2017-05-12)
|
4
|
+
|
5
|
+
* Correctly print version if patch level was missing
|
6
|
+
* Only set DepSelector::Debug.log.level if DepSelector::Debug is defined
|
7
|
+
* Improve regex to avoid unwanted string replacement
|
8
|
+
|
3
9
|
## 2.0.2 (2017-05-11)
|
4
10
|
|
5
11
|
* Set DepSelector log level to INFO
|
data/README.md
CHANGED
@@ -103,7 +103,7 @@ Now use the "--env-constraints", "universe" and "expanded-run-list" options to p
|
|
103
103
|
For example:
|
104
104
|
|
105
105
|
```
|
106
|
-
knife depsolver --env-constraints
|
106
|
+
knife depsolver --env-constraints production-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe my-org-universe-2017-05-01-18.52.40-1c8e59e23530b1e1a8e0b3b3cc5236a29c84e469.txt --expanded-run-list expanded-run-list-2017-05-01-18.52.40-387d90499514747792a805213c30be13d830d31f.txt
|
107
107
|
```
|
108
108
|
|
109
109
|
Now it is easy to modify the environment cookbook version constraints or the cookbook universe input files to see the impact on the depsolver.
|
@@ -121,7 +121,7 @@ knife depsolver --env-constraints production-environment-2017-05-01-18.52.40-5f5
|
|
121
121
|
Sometimes you want to only see the list of cookbooks, and their cookbook dependency version constraints, that ultimately would be sent to the depsolver without actually triggering the depsolver calculation. This is especially helpful when the depsolver isn't returning any results because it can't calculate a solution in a reasonable amount of time. This can be done by using the `--print-constrained-cookbook-set` option.
|
122
122
|
|
123
123
|
```
|
124
|
-
knife depsolver --env-constraints
|
124
|
+
knife depsolver --env-constraints production-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe my-org-universe-2017-05-01-18.52.40-1c8e59e23530b1e1a8e0b3b3cc5236a29c84e469.txt --expanded-run-list expanded-run-list-2017-05-01-18.52.40-387d90499514747792a805213c30be13d830d31f.txt --print-constrained-cookbook-set
|
125
125
|
```
|
126
126
|
|
127
127
|
Now you can review the output to see if you can find anything that could be causing problems for the depsolver. You can make changes to the input files to see the impact on the list of cookbooks that would be sent to the depsolver.
|
data/lib/chef/knife/depsolver.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require 'chef/knife'
|
2
2
|
require 'digest'
|
3
3
|
|
4
|
+
module DepSelector
|
5
|
+
class VersionConstraint
|
6
|
+
def to_s
|
7
|
+
version = @missing_patch_level ? "#{@version.major}.#{@version.minor}" : @version.to_s
|
8
|
+
"#{@op} #{version}"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
4
13
|
class Chef
|
5
14
|
class Knife
|
6
15
|
class Depsolver < Knife
|
@@ -49,7 +58,7 @@ class Chef
|
|
49
58
|
|
50
59
|
def run
|
51
60
|
begin
|
52
|
-
DepSelector::Debug.log.level = Logger::INFO
|
61
|
+
DepSelector::Debug.log.level = Logger::INFO if defined?(DepSelector::Debug)
|
53
62
|
use_local_depsolver = false
|
54
63
|
if config[:env_constraints_filter_universe]
|
55
64
|
if config[:node] || config[:environment] || config[:timeout] || config[:capture] || config[:expanded_run_list] || config[:csv_universe_to_json]
|
@@ -380,7 +389,7 @@ class Chef
|
|
380
389
|
selector = DepSelector::Selector.new(graph, (timeout_ms / 1000.0))
|
381
390
|
|
382
391
|
constrained_cookbook_set = selector.send(:trim_unreachable_packages, selector.dep_graph, run_list)
|
383
|
-
constrained_cookbook_set.sort {|x,y| x.name <=> y.name}.each {|c| puts c.to_s.gsub(
|
392
|
+
constrained_cookbook_set.sort {|x,y| x.name <=> y.name}.each {|c| puts c.to_s.gsub(/^Package/, 'Cookbook')}
|
384
393
|
|
385
394
|
rescue => e
|
386
395
|
puts = [:error, :exception, e.message, [e.backtrace]]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-depsolver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremiah Snapp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Knife plugin that uses Chef Server to calculate cookbook dependencies
|
14
14
|
for a given run_list.
|