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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dd5a344b9fcfc7c4e08e5199122981852f396f1
4
- data.tar.gz: 7973c0cd7d13687bc3fe81575e6f6b9bff430f04
3
+ metadata.gz: b2dd2e1ec1022caf3f4fc83c14292241b592240f
4
+ data.tar.gz: c67dec4e629b5b7395e7b4336aad1d386f4e88ee
5
5
  SHA512:
6
- metadata.gz: 733d5a061fc6bbaa400af405f8fd1419fef2f0fe2b313360dc91d5adf4e99b2b55c4293d2fea475a452f8260f12ef37e144dc098cbc58432db171121fc9f3a35
7
- data.tar.gz: dca4c199d6ba80069efd8ca2db97d2c94af28580fd8f7ecbcac146d865345d920e12b422739e9153584ffe5608fbb63465ec24dd7726cf1c8c2dcedea7a99838
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 rehearsal-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe automate-universe-2017-05-01-18.52.40-1c8e59e23530b1e1a8e0b3b3cc5236a29c84e469.txt --expanded-run-list expanded-run-list-2017-05-01-18.52.40-387d90499514747792a805213c30be13d830d31f.txt
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 rehearsal-environment-2017-05-01-18.52.40-5f5843d819ecb0b174f308d76d4336bb7bbfacbf.txt --universe automate-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
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.
@@ -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(/Package/, 'Cookbook')}
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]]
@@ -1,3 +1,3 @@
1
1
  module KnifeDepsolver
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
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.2
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 00:00:00.000000000 Z
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.