knife-chop 0.5.15 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTAwNTMzYTI2OWYyN2NhYzg4N2I1NDlhOGJiNmY5YzBiMzYxZDY4Yg==
4
+ NGQyNmM4YzYxMmJjMmY4N2UzMzNjYjUwYjM1ZGRjZGM2YTQ2ODM0Mw==
5
5
  data.tar.gz: !binary |-
6
- MzM1ZTgyNzdkOWNiM2FjZDc0ODYzZWI1MWU4YjZmNDg2N2FjMGM4NQ==
6
+ ZTg5MGQwYWQ0ZmI3YmM0ZWZkNGM3YWZiOTMyY2EzMjUwNmI1ODgyOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjUwZmM1YWZiN2ZjM2EwNjE2ZjE5ZWYyMjVkNzNjYWY4ODVmYjY0MmFhZjA5
10
- ZjQ4ZjgwNTc0Y2MxYWQ1MWI0MjI2YmRjZDU1NDg3YjQ0YWVhNjRlY2UwODg3
11
- NzBhOWExOWZkYmE5NGVjN2YzZTgyZTVmNzZjZGQyODY5MDUwNTc=
9
+ OGQ5NDhlYmNjMGEyZmFhMzU2MGZmNjAyZWU1MjI1NjYyNzRlZWI0MzQ0ZjA0
10
+ NTYxNTA0MDU1ZDg4ZDdkZWRkMGJlOWUwYTZlNTExNTMzYTc4Y2I0MTFmZmU4
11
+ YTczNGRiNTFkMDNiZjQ1YmYyNzMwODc3NGM1MzkzNGQwZGMyMjE=
12
12
  data.tar.gz: !binary |-
13
- OGI3YzM1NDJjNzU0YzdhMDFiYzIwYWMwNTZiZmQyNDg1NzQwOWUzNmEyN2Qw
14
- MDg2OTQ2NzQ4OWY3NDdkY2MyMzE3NGU4Y2M5NWNkY2Y3ZTdiZGY3NjRlYWFk
15
- Zjc1YmIzYWE1YzU3OTkyZWE0MzA2ZWRjMjFjMjZmNzcwNGNlYWM=
13
+ OGM2NDNjODRmOGVlYzk0NWViZmM2Mzc1MzAzYTc5OTZiZGI3MTcxN2Y2OTY0
14
+ MmQ3YTFjZTA3M2VkNzJiYzExNzdmMTcwYTNlNTQ1ZTc1YzYyNmJhMmI1Mjc4
15
+ NmM5ZmY1MzRjNjFjZDk2MWE5YTk1ZDdjNWM3ZDU2NzllZGE1ZmQ=
data/Gemfile CHANGED
@@ -7,9 +7,10 @@ gem 'logging', '~> 1.8', '>= 1.8.2'
7
7
  gem 'inifile', '~> 2.0', '>= 2.0.2'
8
8
  gem 'json', '~> 1.8', '>= 1.8.1' #, '<= 1.7.7'
9
9
  gem 'mixlib-config', '~> 2.1', '>= 2.1.0'
10
- gem 'chef', '~> 11.10', '>= 11.10.0'
10
+ gem 'chef', '~> 11.12', '>= 11.12.0'
11
11
  gem 'unf', '~> 0.1', '>= 0.1.4' # For Fog
12
12
  gem 'knife-ec2', '~> 0.6', '>= 0.6.6'
13
+ gem 'safe_yaml'
13
14
  #
14
15
  ## Add dependencies to develop your gem here.
15
16
  ## Include everything needed to run rake, tests, features, etc.
@@ -19,6 +20,6 @@ group :development do
19
20
  # gem "cucumber", ">= 0"
20
21
  # gem "bundler", "~> 1.0"
21
22
  # gem "rcov", ">= 0"
22
- # gem 'jeweler', '>= 1.8.8'
23
- # gem "rspec", '~> 2.14', '>= 2.14.1'
23
+ gem 'jeweler', '>= 2.0.1', '~> 2.0'
24
+ gem "rspec", '~> 2.14', '>= 2.14.1'
24
25
  end
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- knife-chop (0.5.15)
4
+ knife-chop (0.6.7)
5
5
  awesome_print (~> 1.2, >= 1.2.0)
6
- chef (~> 11.10, >= 11.10.0)
6
+ chef (~> 11.12, >= 11.10.0)
7
7
  colorize (~> 0.7, >= 0.7.1)
8
8
  inifile (~> 2.0, >= 2.0.2)
9
9
  json (~> 1.8, >= 1.8.1)
@@ -16,12 +16,12 @@ GEM
16
16
  remote: http://rubygems.org/
17
17
  specs:
18
18
  addressable (2.3.6)
19
- akami (1.2.1)
19
+ akami (1.2.2)
20
20
  gyoku (>= 0.4.0)
21
21
  nokogiri
22
22
  awesome_print (1.2.0)
23
23
  builder (3.2.2)
24
- chef (11.12.0)
24
+ chef (11.12.4)
25
25
  chef-zero (~> 2.0, >= 2.0.2)
26
26
  diff-lcs (~> 1.2, >= 1.2.4)
27
27
  erubis (~> 2.7)
@@ -35,7 +35,7 @@ GEM
35
35
  mixlib-shellout (~> 1.4)
36
36
  net-ssh (~> 2.6)
37
37
  net-ssh-multi (~> 1.1)
38
- ohai (~> 7.0)
38
+ ohai (~> 7.0.4)
39
39
  pry (~> 0.9)
40
40
  rest-client (>= 1.0.4, < 1.7.0)
41
41
  yajl-ruby (~> 1.1)
@@ -83,7 +83,7 @@ GEM
83
83
  ffi (>= 1.0.1)
84
84
  gyoku (1.1.1)
85
85
  builder (>= 2.1.2)
86
- hashie (2.1.0)
86
+ hashie (2.1.1)
87
87
  highline (1.6.21)
88
88
  httpclient (2.3.4.1)
89
89
  httpi (0.9.7)
@@ -100,12 +100,12 @@ GEM
100
100
  rake
101
101
  rdoc
102
102
  json (1.8.1)
103
- jwt (0.1.11)
103
+ jwt (0.1.13)
104
104
  multi_json (>= 1.5)
105
105
  knife-ec2 (0.8.0)
106
106
  fog (~> 1.20.0)
107
107
  knife-windows (>= 0.5.12)
108
- knife-windows (0.5.15)
108
+ knife-windows (0.6.0)
109
109
  em-winrm (~> 0.5, >= 0.5.4)
110
110
  little-plugger (1.1.3)
111
111
  logging (1.8.2)
@@ -113,26 +113,26 @@ GEM
113
113
  multi_json (>= 1.8.4)
114
114
  method_source (0.8.2)
115
115
  mime-types (1.25.1)
116
- mini_portile (0.5.3)
116
+ mini_portile (0.6.0)
117
117
  mixlib-authentication (1.3.0)
118
118
  mixlib-log
119
- mixlib-cli (1.4.0)
119
+ mixlib-cli (1.5.0)
120
120
  mixlib-config (2.1.0)
121
121
  mixlib-log (1.6.0)
122
122
  mixlib-shellout (1.4.0)
123
- multi_json (1.9.2)
123
+ multi_json (1.10.0)
124
124
  multi_xml (0.5.5)
125
125
  multipart-post (2.0.0)
126
- net-scp (1.1.2)
126
+ net-scp (1.2.1)
127
127
  net-ssh (>= 2.6.5)
128
- net-ssh (2.8.0)
128
+ net-ssh (2.9.1)
129
129
  net-ssh-gateway (1.2.0)
130
130
  net-ssh (>= 2.6.5)
131
131
  net-ssh-multi (1.2.0)
132
132
  net-ssh (>= 2.6.5)
133
133
  net-ssh-gateway (>= 1.2.0)
134
- nokogiri (1.6.1)
135
- mini_portile (~> 0.5.0)
134
+ nokogiri (1.6.2.1)
135
+ mini_portile (= 0.6.0)
136
136
  nori (1.1.5)
137
137
  oauth2 (0.9.3)
138
138
  faraday (>= 0.8, < 0.10)
@@ -140,7 +140,7 @@ GEM
140
140
  multi_json (~> 1.3)
141
141
  multi_xml (~> 0.5)
142
142
  rack (~> 1.2)
143
- ohai (7.0.0)
143
+ ohai (7.0.4)
144
144
  ipaddress
145
145
  mime-types (~> 1.16)
146
146
  mixlib-cli
@@ -154,7 +154,7 @@ GEM
154
154
  method_source (~> 0.8)
155
155
  slop (~> 3.4)
156
156
  rack (1.5.2)
157
- rake (10.2.2)
157
+ rake (10.3.1)
158
158
  rdoc (4.1.1)
159
159
  json (~> 1.4)
160
160
  rest-client (1.6.7)
@@ -168,6 +168,7 @@ GEM
168
168
  diff-lcs (>= 1.1.3, < 2.0)
169
169
  rspec-mocks (2.14.6)
170
170
  rubyntlm (0.1.1)
171
+ safe_yaml (1.0.3)
171
172
  savon (0.9.5)
172
173
  akami (~> 1.0)
173
174
  builder (>= 2.1.2)
@@ -200,14 +201,15 @@ PLATFORMS
200
201
 
201
202
  DEPENDENCIES
202
203
  awesome_print (~> 1.2, >= 1.2.0)
203
- chef (~> 11.10, >= 11.10.0)
204
+ chef (~> 11.12, >= 11.12.0)
204
205
  colorize (~> 0.7, >= 0.7.1)
205
206
  inifile (~> 2.0, >= 2.0.2)
206
- jeweler (>= 1.8.8)
207
+ jeweler (~> 2.0, >= 2.0.1)
207
208
  json (~> 1.8, >= 1.8.1)
208
209
  knife-chop!
209
210
  knife-ec2 (~> 0.6, >= 0.6.6)
210
211
  logging (~> 1.8, >= 1.8.2)
211
212
  mixlib-config (~> 2.1, >= 2.1.0)
212
213
  rspec (~> 2.14, >= 2.14.1)
214
+ safe_yaml
213
215
  unf (~> 0.1, >= 0.1.4)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.15
1
+ 0.6.7
data/bin/chop CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  require 'rubygems'
4
4
 
5
+ require 'safe_yaml'
6
+ SafeYAML::OPTIONS[:default_mode] = :safe
7
+
5
8
  # Borrowing from "whiches" gem ...
6
9
  cmd = 'knife'
7
10
  exes = []
@@ -2,16 +2,15 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: knife-chop 0.5.12 ruby lib
6
5
 
7
6
  Gem::Specification.new do |s|
8
7
  s.name = "knife-chop"
9
- s.version = IO.read(File.join(File.dirname(__FILE__), 'VERSION')).chomp rescue '1.0.0'
8
+ s.version = IO.read('VERSION')
10
9
 
11
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
11
  s.require_paths = ["lib"]
13
12
  s.authors = ["Christo De Lange"]
14
- s.date = "2014-04-10"
13
+ s.date = "2014-05-14"
15
14
  s.description = "Knife plugin to assist with the upload and sync of Chef server assets like roles, environments and cookbooks allowing for multiple parts to be uploaded at once to multiple environments. Resources can be matched with regular expressions."
16
15
  s.email = "rubygems@dldinternet.com"
17
16
  s.executables = ["chop"]
@@ -29,6 +28,7 @@ Gem::Specification.new do |s|
29
28
  "VERSION",
30
29
  "bin/chop",
31
30
  "knife-chop.gemspec",
31
+ "knife-chop.iml",
32
32
  "lib/chef/knife/chop/chef_data_bag_item.rb",
33
33
  "lib/chef/knife/chop/chef_environment.rb",
34
34
  "lib/chef/knife/chop/chef_knife.rb",
@@ -79,21 +79,19 @@ Gem::Specification.new do |s|
79
79
  s.rubygems_version = "2.2.2"
80
80
  s.summary = "Knife plugin to ease the upload and sync of Chef server assets"
81
81
 
82
- if s.respond_to? :specification_version
82
+ if s.respond_to? :specification_version then
83
83
  s.specification_version = 4
84
84
 
85
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0')
85
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
86
86
  s.add_runtime_dependency(%q<awesome_print>, [">= 1.2.0", "~> 1.2"])
87
87
  s.add_runtime_dependency(%q<colorize>, [">= 0.7.1", "~> 0.7"])
88
88
  s.add_runtime_dependency(%q<logging>, [">= 1.8.2", "~> 1.8"])
89
89
  s.add_runtime_dependency(%q<inifile>, [">= 2.0.2", "~> 2.0"])
90
90
  s.add_runtime_dependency(%q<json>, [">= 1.8.1", "~> 1.8"])
91
91
  s.add_runtime_dependency(%q<mixlib-config>, [">= 2.1.0", "~> 2.1"])
92
- s.add_runtime_dependency(%q<chef>, [">= 11.10.0", "~> 11.10"])
92
+ s.add_runtime_dependency(%q<chef>, [">= 11.10.0", "~> 11.12"])
93
93
  s.add_runtime_dependency(%q<unf>, [">= 0.1.4", "~> 0.1"])
94
94
  s.add_runtime_dependency(%q<knife-ec2>, [">= 0.6.6", "~> 0.6"])
95
- s.add_development_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"])
96
- s.add_development_dependency(%q<jeweler>, [">= 1.8.8"])
97
95
  else
98
96
  s.add_dependency(%q<awesome_print>, [">= 1.2.0", "~> 1.2"])
99
97
  s.add_dependency(%q<colorize>, [">= 0.7.1", "~> 0.7"])
@@ -101,11 +99,9 @@ Gem::Specification.new do |s|
101
99
  s.add_dependency(%q<inifile>, [">= 2.0.2", "~> 2.0"])
102
100
  s.add_dependency(%q<json>, [">= 1.8.1", "~> 1.8"])
103
101
  s.add_dependency(%q<mixlib-config>, [">= 2.1.0", "~> 2.1"])
104
- s.add_dependency(%q<chef>, [">= 11.10.0", "~> 11.10"])
102
+ s.add_dependency(%q<chef>, [">= 11.10.0", "~> 11.12"])
105
103
  s.add_dependency(%q<unf>, [">= 0.1.4", "~> 0.1"])
106
104
  s.add_dependency(%q<knife-ec2>, [">= 0.6.6", "~> 0.6"])
107
- s.add_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"])
108
- s.add_dependency(%q<jeweler>, [">= 1.8.8"])
109
105
  end
110
106
  else
111
107
  s.add_dependency(%q<awesome_print>, [">= 1.2.0", "~> 1.2"])
@@ -114,11 +110,9 @@ Gem::Specification.new do |s|
114
110
  s.add_dependency(%q<inifile>, [">= 2.0.2", "~> 2.0"])
115
111
  s.add_dependency(%q<json>, [">= 1.8.1", "~> 1.8"])
116
112
  s.add_dependency(%q<mixlib-config>, [">= 2.1.0", "~> 2.1"])
117
- s.add_dependency(%q<chef>, [">= 11.10.0", "~> 11.10"])
113
+ s.add_dependency(%q<chef>, [">= 11.10.0", "~> 11.12"])
118
114
  s.add_dependency(%q<unf>, [">= 0.1.4", "~> 0.1"])
119
115
  s.add_dependency(%q<knife-ec2>, [">= 0.6.6", "~> 0.6"])
120
- s.add_dependency(%q<rspec>, [">= 2.14.1", "~> 2.14"])
121
- s.add_dependency(%q<jeweler>, [">= 1.8.8"])
122
116
  end
123
117
  end
124
118
 
@@ -0,0 +1,178 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="FacetManager">
4
+ <facet type="bash" name="BashSupport">
5
+ <configuration>
6
+ <operationMode type="AcceptAll" />
7
+ </configuration>
8
+ </facet>
9
+ </component>
10
+ <component name="ModuleRunConfigurationManager">
11
+ <configuration default="false" name="chop" type="RubyRunConfigurationType" factoryName="Ruby" singleton="true">
12
+ <module name="knife-chop" />
13
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
14
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$/bin" />
15
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
16
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="RVM: ruby-1.9.3-p545 [knife-chop]" />
17
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
18
+ <envs>
19
+ <env name="RC_KEYP" value="curriculum-poc-admin" />
20
+ <env name="KNIFE_CLIENT_KEY" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/chef/server/aws.curriculum-poc/cdelange.pem" />
21
+ <env name="EC2_HOME" value="/usr/local/ec2-api-tools" />
22
+ <env name="RC_CMSA" value="aws.curriculum-poc" />
23
+ <env name="RC_PS1" value="'\e[0;30m\e[47m===== \t (\! $?) \u@\H:\w =====\e[m-\e[0m\e[48;5;56m$(parse_git_branch)\e[m-${PSRC}-${PSOC}-$(parse_rvm_env)\n$'" />
24
+ <env name="KNIFE_CHEF_SERVER_URL" value="https://chef.poc.ae1.currdc.net" />
25
+ <env name="KNIFE_VALIDATION_CLIENT_NAME" value="chef-validator" />
26
+ <env name="AWS_REGION" value="us-east-1" />
27
+ <env name="RC_CMMS" value="chef" />
28
+ <env name="AWS_INSTANCE_TYPE" value="t1.micro" />
29
+ <env name="RC_ZONE" value="use-1" />
30
+ <env name="AWS_SECRET_ACCESS_KEY" value="kvPq38Ca0HXjC+AIRhQfdNifawtbHYUGPkkC1N/+" />
31
+ <env name="AWS_S3CFG" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/aws/aws.curriculum-poc/cdelange.s3cfg" />
32
+ <env name="KNIFE_CLIENT_NAME" value="cdelange" />
33
+ <env name="EC2_URL" value="https://ec2.us-east-1.amazonaws.com" />
34
+ <env name="AWS_DEFAULT_OUTPUT" value="text" />
35
+ <env name="AWS_KEY_PATH" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/aws/aws.curriculum-poc/curriculum-poc-admin/curriculum-poc-admin-aws.curriculum-poc-use-1.pem" />
36
+ <env name="AWS_SECRET_KEY" value="kvPq38Ca0HXjC+AIRhQfdNifawtbHYUGPkkC1N/+" />
37
+ <env name="KNIFE_CHEF_SERVER_NAME" value="chef.poc.ae1.currdc.net" />
38
+ <env name="AWS_SUBNET_ID" value="subnet-e9861081" />
39
+ <env name="RC_USER" value="cdelange" />
40
+ <env name="RC_CLOUD" value="aws" />
41
+ <env name="RC_DIR" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc" />
42
+ <env name="AWS_DEFAULT_REGION" value="us-east-1" />
43
+ <env name="AWS_SSH_USERNAME" value="ec2-user" />
44
+ <env name="AWS_SECURITY_GROUPS" value="default" />
45
+ <env name="AWS_ACCESS_KEY_ID" value="AKIAJFTF66B2U47ALRSQ" />
46
+ <env name="KNIFE_CHEF_SERVER_INT_IP" value="10.162.4.20" />
47
+ <env name="KNIFE_WHISK_CONFIG" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/aws/aws.curriculum-poc/whisk.yaml" />
48
+ <env name="KNIFE_VALIDATION_KEY" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/chef/server/aws.curriculum-poc/chef-validator.pem" />
49
+ <env name="RC_COMPLETION" value="/Users/cdl/IDrive-Sync/Dropbox/DLDInternet/rc/bash_completion.rc" />
50
+ <env name="RC_CMSV" value="server" />
51
+ <env name="AWS_ZONE" value="us-east-1a" />
52
+ <env name="AWS_KEYPAIR_NAME" value="curriculum-poc-admin" />
53
+ <env name="RC_ACCT" value="aws.curriculum-poc" />
54
+ </envs>
55
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
56
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
57
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
58
+ <COVERAGE_PATTERN ENABLED="true">
59
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
60
+ </COVERAGE_PATTERN>
61
+ </EXTENSION>
62
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
63
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/bin/chop" />
64
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="--log-level info --repo-path /Users/cdl/IDrive-Sync/Dropbox/Amplify/ws/section-31/devops/chef --precedence rb,yaml --resources roles,cookbooks --roles '.*' --environments '.*' --cookbooks 'role,amplify-jenkins' -I 0" />
65
+ <RunnerSettings RunnerId="RubyDebugRunner" />
66
+ <RunnerSettings RunnerId="RubyRunner" />
67
+ <ConfigurationWrapper RunnerId="RubyDebugRunner" />
68
+ <ConfigurationWrapper RunnerId="RubyRunner" />
69
+ <method />
70
+ </configuration>
71
+ <configuration default="false" name="knife-chop" type="RubyRunConfigurationType" factoryName="Ruby" singleton="true" temporary="true">
72
+ <module name="knife-chop" />
73
+ <RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
74
+ <RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$" />
75
+ <RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
76
+ <RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
77
+ <RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
78
+ <envs />
79
+ <EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
80
+ <EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
81
+ <EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
82
+ <COVERAGE_PATTERN ENABLED="true">
83
+ <PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
84
+ </COVERAGE_PATTERN>
85
+ </EXTENSION>
86
+ <EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
87
+ <RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$USER_HOME$/.rvm/gems/ruby-1.9.3-p545@knife-chop/gems/chef-11.12.4/bin/knife" />
88
+ <RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
89
+ <RunnerSettings RunnerId="RubyDebugRunner" />
90
+ <RunnerSettings RunnerId="RubyRunner" />
91
+ <ConfigurationWrapper RunnerId="RubyDebugRunner" />
92
+ <ConfigurationWrapper RunnerId="RubyRunner" />
93
+ <method />
94
+ </configuration>
95
+ </component>
96
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
97
+ <content url="file://$MODULE_DIR$" />
98
+ <orderEntry type="jdk" jdkName="RVM: ruby-1.9.3-p545 [knife-chop]" jdkType="RUBY_SDK" />
99
+ <orderEntry type="sourceFolder" forTests="false" />
100
+ <orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.6, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
101
+ <orderEntry type="library" scope="PROVIDED" name="akami (v1.2.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
102
+ <orderEntry type="library" scope="PROVIDED" name="awesome_print (v1.2.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
103
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
104
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v1.6.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
105
+ <orderEntry type="library" scope="PROVIDED" name="chef (v11.12.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
106
+ <orderEntry type="library" scope="PROVIDED" name="chef-zero (v2.0.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
107
+ <orderEntry type="library" scope="PROVIDED" name="coderay (v1.1.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
108
+ <orderEntry type="library" scope="PROVIDED" name="colorize (v0.7.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
109
+ <orderEntry type="library" scope="PROVIDED" name="descendants_tracker (v0.0.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
110
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
111
+ <orderEntry type="library" scope="PROVIDED" name="em-winrm (v0.5.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
112
+ <orderEntry type="library" scope="PROVIDED" name="erubis (v2.7.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
113
+ <orderEntry type="library" scope="PROVIDED" name="eventmachine (v1.0.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
114
+ <orderEntry type="library" scope="PROVIDED" name="excon (v0.31.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
115
+ <orderEntry type="library" scope="PROVIDED" name="faraday (v0.9.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
116
+ <orderEntry type="library" scope="PROVIDED" name="ffi (v1.9.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
117
+ <orderEntry type="library" scope="PROVIDED" name="fog (v1.20.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
118
+ <orderEntry type="library" scope="PROVIDED" name="formatador (v0.2.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
119
+ <orderEntry type="library" scope="PROVIDED" name="git (v1.2.6, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
120
+ <orderEntry type="library" scope="PROVIDED" name="github_api (v0.11.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
121
+ <orderEntry type="library" scope="PROVIDED" name="gssapi (v1.0.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
122
+ <orderEntry type="library" scope="PROVIDED" name="gyoku (v1.1.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
123
+ <orderEntry type="library" scope="PROVIDED" name="hashie (v2.1.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
124
+ <orderEntry type="library" scope="PROVIDED" name="highline (v1.6.21, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
125
+ <orderEntry type="library" scope="PROVIDED" name="httpclient (v2.3.4.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
126
+ <orderEntry type="library" scope="PROVIDED" name="httpi (v0.9.7, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
127
+ <orderEntry type="library" scope="PROVIDED" name="inifile (v2.0.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
128
+ <orderEntry type="library" scope="PROVIDED" name="ipaddress (v0.8.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
129
+ <orderEntry type="library" scope="PROVIDED" name="jeweler (v2.0.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
130
+ <orderEntry type="library" scope="PROVIDED" name="json (v1.8.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
131
+ <orderEntry type="library" scope="PROVIDED" name="jwt (v0.1.13, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
132
+ <orderEntry type="library" scope="PROVIDED" name="knife-ec2 (v0.8.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
133
+ <orderEntry type="library" scope="PROVIDED" name="knife-windows (v0.6.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
134
+ <orderEntry type="library" scope="PROVIDED" name="little-plugger (v1.1.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
135
+ <orderEntry type="library" scope="PROVIDED" name="logging (v1.8.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
136
+ <orderEntry type="library" scope="PROVIDED" name="method_source (v0.8.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
137
+ <orderEntry type="library" scope="PROVIDED" name="mime-types (v1.25.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
138
+ <orderEntry type="library" scope="PROVIDED" name="mini_portile (v0.6.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
139
+ <orderEntry type="library" scope="PROVIDED" name="mixlib-authentication (v1.3.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
140
+ <orderEntry type="library" scope="PROVIDED" name="mixlib-cli (v1.5.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
141
+ <orderEntry type="library" scope="PROVIDED" name="mixlib-config (v2.1.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
142
+ <orderEntry type="library" scope="PROVIDED" name="mixlib-log (v1.6.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
143
+ <orderEntry type="library" scope="PROVIDED" name="mixlib-shellout (v1.4.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
144
+ <orderEntry type="library" scope="PROVIDED" name="multi_json (v1.10.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
145
+ <orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.5.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
146
+ <orderEntry type="library" scope="PROVIDED" name="multipart-post (v2.0.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
147
+ <orderEntry type="library" scope="PROVIDED" name="net-scp (v1.2.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
148
+ <orderEntry type="library" scope="PROVIDED" name="net-ssh (v2.9.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
149
+ <orderEntry type="library" scope="PROVIDED" name="net-ssh-gateway (v1.2.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
150
+ <orderEntry type="library" scope="PROVIDED" name="net-ssh-multi (v1.2.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
151
+ <orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.6.2.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
152
+ <orderEntry type="library" scope="PROVIDED" name="nori (v1.1.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
153
+ <orderEntry type="library" scope="PROVIDED" name="oauth2 (v0.9.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
154
+ <orderEntry type="library" scope="PROVIDED" name="ohai (v7.0.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
155
+ <orderEntry type="library" scope="PROVIDED" name="pry (v0.9.12.6, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
156
+ <orderEntry type="library" scope="PROVIDED" name="rack (v1.5.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
157
+ <orderEntry type="library" scope="PROVIDED" name="rake (v10.3.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
158
+ <orderEntry type="library" scope="PROVIDED" name="rdoc (v4.1.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
159
+ <orderEntry type="library" scope="PROVIDED" name="rest-client (v1.6.7, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
160
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v2.14.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
161
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.14.8, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
162
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.14.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
163
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.14.6, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
164
+ <orderEntry type="library" scope="PROVIDED" name="rubyntlm (v0.1.1, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
165
+ <orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
166
+ <orderEntry type="library" scope="PROVIDED" name="savon (v0.9.5, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
167
+ <orderEntry type="library" scope="PROVIDED" name="slop (v3.5.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
168
+ <orderEntry type="library" scope="PROVIDED" name="systemu (v2.5.2, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
169
+ <orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
170
+ <orderEntry type="library" scope="PROVIDED" name="unf (v0.1.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
171
+ <orderEntry type="library" scope="PROVIDED" name="unf_ext (v0.0.6, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
172
+ <orderEntry type="library" scope="PROVIDED" name="uuidtools (v2.1.4, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
173
+ <orderEntry type="library" scope="PROVIDED" name="wasabi (v1.0.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
174
+ <orderEntry type="library" scope="PROVIDED" name="winrm (v1.1.3, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
175
+ <orderEntry type="library" scope="PROVIDED" name="yajl-ruby (v1.2.0, RVM: ruby-1.9.3-p545 [knife-chop]) [gem]" level="application" />
176
+ </component>
177
+ </module>
178
+
@@ -34,7 +34,7 @@ end
34
34
 
35
35
  class ::Chef::Knife::CookbookUpload
36
36
  def run
37
- raise StandardError.new("I was crafted from Chef::Knife::VERSION == '11.6.2'. Please verify that #{self.class.name}.run is still relevant in your version '#{Chef::VERSION}'!") unless Chef::VERSION.match(%r/^11\./)
37
+ raise StandardError.new("I was crafted from Chef::Knife::VERSION == '11.6.2'. Please verify that #{self.class.name}.run is still relevant in your version '#{Chef::VERSION}'!") unless Chef::VERSION.match(%r/^11\.(6|8|10|12)/)
38
38
  # Sanity check before we load anything from the server
39
39
  unless config[:all]
40
40
  if @name_args.empty?
@@ -44,7 +44,7 @@ class ::Chef::Knife::CookbookUpload
44
44
  end
45
45
  end
46
46
 
47
- config[:cookbook_path] ||= Chef::Config[:cookbook_path]
47
+ config[:cookbook_path] ||= ::Chef::Config[:cookbook_path]
48
48
 
49
49
  if @name_args.empty? and ! config[:all]
50
50
  show_usage
@@ -53,13 +53,14 @@ class ::Chef::Knife::CookbookUpload
53
53
  end
54
54
 
55
55
  assert_environment_valid!
56
+ warn_about_cookbook_shadowing
56
57
  version_constraints_to_update = {}
57
58
  upload_failures = 0
58
59
  upload_ok = 0
59
60
 
60
61
  # Get a list of cookbooks and their versions from the server
61
62
  # to check for the existence of a cookbook's dependencies.
62
- @server_side_cookbooks = Chef::CookbookVersion.list_all_versions
63
+ @server_side_cookbooks = ::Chef::CookbookVersion.list_all_versions
63
64
  justify_width = @server_side_cookbooks.map {|name| name.size}.max.to_i + 2
64
65
  if config[:all]
65
66
  cookbook_repo.load_cookbooks
@@ -74,7 +75,7 @@ class ::Chef::Knife::CookbookUpload
74
75
  rescue ::Chef::Exceptions::CookbookFrozen
75
76
  ui.warn("Not updating version constraints for some cookbooks in the environment as the cookbook is frozen.")
76
77
  end
77
- ui.info("Uploaded all cookbooks.")
78
+ ui.step("Uploaded all cookbooks.")
78
79
  else
79
80
  if @name_args.empty?
80
81
  show_usage
@@ -82,7 +83,6 @@ class ::Chef::Knife::CookbookUpload
82
83
  exit 1
83
84
  end
84
85
 
85
- @cookbooks_to_upload = nil
86
86
  cookbooks_to_upload.each do |cookbook_name, cookbook|
87
87
  cookbook.freeze_version if config[:freeze]
88
88
  begin
@@ -91,16 +91,27 @@ class ::Chef::Knife::CookbookUpload
91
91
  version_constraints_to_update[cookbook_name] = cookbook.version
92
92
  rescue ::Chef::Exceptions::CookbookNotFoundInRepo => e
93
93
  upload_failures += 1
94
- ui.error("Could not find cookbook #{cookbook_name} in your cookbook path, skipping it")
94
+ ui.fatal("Could not find cookbook #{cookbook_name} in your cookbook path, skipping it")
95
95
  Log.debug(e)
96
96
  upload_failures += 1
97
97
  rescue ::Chef::Exceptions::CookbookFrozen
98
- ui.warn("Not updating version constraints for #{cookbook_name} in the environment as the cookbook is frozen.")
98
+ ui.error("Not updating version constraints for #{cookbook_name} in the environment as the cookbook is frozen.")
99
99
  upload_failures += 1
100
100
  end
101
101
  end
102
102
 
103
103
  # BEGIN changes DLDInternet
104
+ # upload_failures += @name_args.length - @cookbooks_to_upload.length
105
+ #
106
+ # if upload_failures == 0
107
+ # ui.info "Uploaded #{upload_ok} cookbook#{upload_ok > 1 ? "s" : ""}."
108
+ # elsif upload_failures > 0 && upload_ok > 0
109
+ # ui.warn "Uploaded #{upload_ok} cookbook#{upload_ok > 1 ? "s" : ""} ok but #{upload_failures} " +
110
+ # "cookbook#{upload_failures > 1 ? "s" : ""} upload failed."
111
+ # elsif upload_failures > 0 && upload_ok == 0
112
+ # ui.error "Failed to upload #{upload_failures} cookbook#{upload_failures > 1 ? "s" : ""}."
113
+ # exit 1
114
+ # end
104
115
  upload_skips = @name_args.length - @cookbooks_to_upload.length
105
116
 
106
117
  if upload_failures == 0
@@ -109,17 +120,17 @@ class ::Chef::Knife::CookbookUpload
109
120
  elsif upload_skips > 0 && upload_ok > 0
110
121
  ui.step "Uploaded #{upload_ok} #{'cookbook'.plural(upload_ok)} ok but #{upload_skips} #{'cookbook'.plural(upload_skips)} were not included."
111
122
  elsif upload_ok == 0
112
- ui.error "Did not upload any cookbooks."
123
+ ui.fatal "Did not upload any cookbooks."
113
124
  exit 1
114
125
  end
115
126
  elsif upload_failures > 0 && upload_ok > 0
116
127
  if upload_skips == 0
117
- ui.warn "Uploaded #{upload_ok} #{'cookbook'.plural(upload_ok)} ok but #{upload_failures} #{'cookbook'.plural(upload_failures)} failed upload."
128
+ ui.error "Uploaded #{upload_ok} #{'cookbook'.plural(upload_ok)} ok but #{upload_failures} #{'cookbook'.plural(upload_failures)} failed upload."
118
129
  elsif upload_skips > 0
119
- ui.warn "Uploaded #{upload_ok} #{'cookbook'.plural(upload_ok)} ok but #{upload_skips} #{'cookbook'.plural(upload_skips)} were not included and #{upload_failures} #{'cookbook'.plural(upload_failures)} failed upload."
130
+ ui.error "Uploaded #{upload_ok} #{'cookbook'.plural(upload_ok)} ok but #{upload_skips} #{'cookbook'.plural(upload_skips)} were not included and #{upload_failures} #{'cookbook'.plural(upload_failures)} failed upload."
120
131
  end
121
132
  elsif upload_failures > 0 && upload_ok == 0
122
- ui.error "Failed to upload #{upload_failures} #{'cookbook'.plural(upload_failures)}."
133
+ ui.fatal "Failed to upload #{upload_failures} #{'cookbook'.plural(upload_failures)}."
123
134
  exit 1
124
135
  end
125
136
  # END Changes DLDInternet
@@ -1,21 +1,8 @@
1
1
  #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Seth Falcon (<seth@opscode.com>)
4
- # Copyright:: Copyright (c) 2010 Opscode, Inc.
5
- # License:: Apache License, Version 2.0
6
- #
7
- # Licensed under the Apache License, Version 2.0 (the "License");
8
- # you may not use this file except in compliance with the License.
9
- # You may obtain a copy of the License at
10
- #
11
- # http://www.apache.org/licenses/LICENSE-2.0
12
- #
13
- # Unless required by applicable law or agreed to in writing, software
14
- # distributed under the License is distributed on an "AS IS" BASIS,
15
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- # See the License for the specific language governing permissions and
17
- # limitations under the License.
2
+ # Author:: Christo De Lange <opscode@dldinternet.com>
3
+ # Monkey patch for Chef::Knife::DataBagFromFile
18
4
  #
5
+ require 'chef/knife/data_bag_from_file'
19
6
 
20
7
  class ::Chef::Knife::DataBagFromFile
21
8
 
@@ -28,60 +15,25 @@ class ::Chef::Knife::DataBagFromFile
28
15
  @location = 'data_bags'
29
16
  end
30
17
 
31
- ## --------------------------------------------------------------------------------------------------------------------
32
- #def translate()
33
- # if config[:all] == true
34
- # translate_all_data_bags()
35
- # else
36
- # if @name_args[0].nil?
37
- # show_usage
38
- # ui.fatal("You must specify a file to translate")
39
- # exit 1
40
- # end
41
- #
42
- # @data_bag = @name_args.shift
43
- # translate_data_bag_items(@data_bag, @name_args)
44
- # end
45
- #end
46
-
47
- ## --------------------------------------------------------------------------------------------------------------------
48
- #def translate_data_bag_items(data_bag, items = nil)
49
- # items ||= find_all_data_bag_items(data_bag)
50
- # item_paths = normalize_item_paths(items)
51
- # item_paths.each do |item_path|
52
- # item = loader.load_from("#{data_bags_path}", data_bag, item_path)
53
- # dbag = ::Chef::DataBagItem.new
54
- # dbag.data_bag(data_bag)
55
- # dbag.raw_data = item
56
- # part = ::Chef::Part.new(dbag,location)
57
- # part.translate(@config)
58
- # resource = part.resource
59
- # output(format_for_display(resource)) if config[:print_after]
60
- # ui.info("Translated #{@rsrctype.capitalize} #{resource.name}")
61
- # end
62
- #end
63
- #
64
- ## --------------------------------------------------------------------------------------------------------------------
65
- #def data_bags_path
66
- # @data_bag_path ||= "data_bags"
67
- #end
68
- #
69
- ## --------------------------------------------------------------------------------------------------------------------
70
- #def translate_all_data_bags
71
- # loader.find_all_object_dirs("./#{data_bags_path}")
72
- #end
73
- #
74
- ## --------------------------------------------------------------------------------------------------------------------
75
- #def find_all_data_bag_items(data_bag)
76
- # loader.find_all_objects("./#{data_bags_path}/#{data_bag}")
77
- #end
78
- #
79
- ## --------------------------------------------------------------------------------------------------------------------
80
- #def translate_all_data_bags(args)
81
- # data_bags = args.empty? ? find_all_data_bags : [args.shift]
82
- # data_bags.each do |data_bag|
83
- # load_data_bag_items(data_bag)
84
- # end
85
- #end
86
-
18
+ # DLDInternet monkey patch of original
19
+ def load_data_bag_items(data_bag, items = nil)
20
+ items ||= find_all_data_bag_items(data_bag)
21
+ item_paths = normalize_item_paths(items)
22
+ item_paths.each do |item_path|
23
+ item = loader.load_from("#{data_bags_path}", data_bag, item_path)
24
+ item = if use_encryption
25
+ secret = read_secret
26
+ Chef::EncryptedDataBagItem.encrypt_data_bag_item(item, secret)
27
+ else
28
+ item
29
+ end
30
+ dbag = Chef::DataBagItem.new
31
+ dbag.data_bag(data_bag)
32
+ dbag.raw_data = item
33
+ dbag.save
34
+ # BEGIN changes DLDInternet
35
+ ui.info("Updated data_bag_item[#{dbag.data_bag}::#{dbag.id}]")
36
+ # END changes DLDInternet
37
+ end
38
+ end
87
39
  end
@@ -1,20 +1,8 @@
1
1
  #
2
- # Author:: Stephen Delano (<stephen@opscode.com>)
3
- # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
2
+ # Author:: Christo De Lange <opscode@dldinternet.com>
3
+ # Monkey patch for Chef::Knife::EnvironmentFromFile
17
4
  #
5
+ require 'chef/knife/environment_from_file'
18
6
 
19
7
  class ::Chef::Knife::EnvironmentFromFile
20
8
 
@@ -27,29 +15,14 @@ class ::Chef::Knife::EnvironmentFromFile
27
15
  @location = 'environments'
28
16
  end
29
17
 
30
- # --------------------------------------------------------------------------------------------------------------------
18
+ # DLDInternet monkey patch of original
31
19
  def load_environment(env)
32
20
  updated = loader.load_from("environments", env)
33
21
  updated.save
34
22
  output(format_for_display(updated)) if config[:print_after]
23
+ # BEGIN DLDInternet change
35
24
  ui.step("Updated Environment #{updated.name}")
36
- end
37
-
38
- # --------------------------------------------------------------------------------------------------------------------
39
- def run
40
- if config[:all] == true
41
- load_all_environments
42
- else
43
- if @name_args[0].nil?
44
- show_usage
45
- ui.fatal("You must specify a file to load")
46
- exit 1
47
- end
48
-
49
- @name_args.each do |arg|
50
- load_environment(arg)
51
- end
52
- end
25
+ # END DLDInternet change
53
26
  end
54
27
 
55
28
  # --------------------------------------------------------------------------------------------------------------------
@@ -73,7 +46,7 @@ class ::Chef::Knife::EnvironmentFromFile
73
46
  updated = loader.load_from("environments", env)
74
47
  updated.translate(@config,env)
75
48
  output(format_for_display(updated)) if config[:print_after]
76
- ui.info("Translated Environment #{updated.name}")
49
+ ui.step("Translated Environment #{updated.name}")
77
50
  end
78
51
 
79
52
  end
@@ -1,20 +1,8 @@
1
1
  #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Copyright:: Copyright (c) 2009 Opscode, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
2
+ # Author:: Christo De Lange <opscode@dldinternet.com>
3
+ # Monkey patch for Chef::Knife::RoleFromFile
17
4
  #
5
+ require 'chef/knife/role_from_file'
18
6
 
19
7
  class ::Chef::Knife::RoleFromFile
20
8
  # --------------------------------------------------------------------------------------------------------------------
@@ -34,9 +22,34 @@ class ::Chef::Knife::RoleFromFile
34
22
 
35
23
  output(format_for_display(updated)) if config[:print_after]
36
24
 
37
- ui.step("Updated Role #{updated.name}!")
25
+ ui.info("Updated Role #{updated.name}!")
38
26
  end
39
27
  end
28
+
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ private
31
+ # --------------------------------------------------------------------------------------------------------------------
32
+
33
+ # --------------------------------------------------------------------------------------------------------------------
34
+ def translate_all_roles
35
+ roles = find_all_roles
36
+ if roles.empty?
37
+ ui.fatal("Unable to find any role files in '#{roles_path}'")
38
+ exit(1)
39
+ end
40
+ roles.each do |env|
41
+ translate_role(env)
42
+ end
43
+ end
44
+
45
+ # --------------------------------------------------------------------------------------------------------------------
46
+ def translate_role(env)
47
+ updated = loader.load_from("roles", env)
48
+ updated.translate(@config,env)
49
+ output(format_for_display(updated)) if config[:print_after]
50
+ ui.info("Translated Role #{updated.name}")
51
+ end
52
+
40
53
  end
41
54
 
42
55
 
@@ -35,7 +35,7 @@ class Chef
35
35
  #def define_log_methods( ui )
36
36
  def msg(message)
37
37
  caller = Kernel.caller[0]
38
- match = %r/([-\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o.match(caller)
38
+ match = caller.match(%r/([-\.\/\(\)\w]+):(\d+)(?::in `(\w+)')?/o)
39
39
  name = shifted(match[3])
40
40
  @logger.send(name, message)
41
41
  end
@@ -96,8 +96,8 @@ class Chef
96
96
  'error'
97
97
  when 'err'
98
98
  'error'
99
- when 'info'
100
- 'debug'
99
+ # when 'info'
100
+ # 'debug'
101
101
  when 'debug'
102
102
  'trace'
103
103
  else
@@ -151,6 +151,12 @@ class Chef
151
151
  # --------------------------------------------------------------------------------
152
152
  def parsePrecedence(v)
153
153
  @prec_max += 1
154
+ match = v.match(%r/^(json|rb|yaml)$/i)
155
+ unless match
156
+ m = "ERROR: Invalid precedence argument: #{v}. Accept only from this set: [json,rb,yaml]"
157
+ puts m
158
+ raise Exception.new(m)
159
+ end
154
160
  s = { v => @prec_max }
155
161
  match = v.match(%r/^(\S+):(\d+)$/)
156
162
  if match
@@ -650,7 +656,7 @@ class Chef
650
656
  set = {}
651
657
  chef = @config[:repo_path]
652
658
  raise ChopError.new "Oops! Where is the '#{chef}' directory? Also check cookbook path '#{@config[:cookbook_path]}'" unless File.directory?(chef)
653
- abs = File.expand_path("#{chef}/#{path}")#.gsub(%r(^#{@chop_path}), '')
659
+ abs = File.realpath(File.expand_path("#{chef}/#{path}"))
654
660
  raise ChopError.new "Oops! Does 'chef/#{path}' directory exist?" unless File.directory?(abs)
655
661
  Dir.glob("#{abs}/*").each{ |f|
656
662
  match = File.basename(f).match(file_regex)
@@ -79,11 +79,34 @@ class Chef
79
79
  if args[:aggregate] and @use_knife_api
80
80
  subc.name_args << xtra if xtra != ''
81
81
  subc.name_args << set.map{ |name,file|
82
- file
82
+ extname = File.extname(file)
83
+ extname.gsub!(%r/^\./,'')
84
+ case extname
85
+ when /^yaml$/i
86
+ begin
87
+ json = File.join(File::SEPARATOR, [ Dir::Tmpname.tmpdir, Dir::Tmpname.make_tmpname([name, '.json'], nil) ])
88
+ @logger.debug("#{name}.#{extname} => #{json}")
89
+ require 'json'
90
+ require 'yaml'
91
+
92
+ yaml_s = YAML::load(IO.read(file))
93
+ json_s = JSON.dump(yaml_s)
94
+ IO.write(json,json_s)
95
+ rescue Exception => e
96
+ raise ChopError.new("#{e.class.name} - #{e.message}")
97
+ end
98
+ json
99
+ when /^(rb|json)$/
100
+ # noop
101
+ file
102
+ else
103
+ raise ChopError.new("'#{extname}' files are not supported!")
104
+ end
83
105
  }
84
106
  subc.name_args.flatten!
85
107
  #cmd = callCmdProc(filp, cmd, set.map{|name,file| name}.to_s, set.map{|name,file| file}.join(' '))
86
108
  @logger.info "#{cmd} #{set.map{|name,file| file}.ai} ... "
109
+ @logger.info "#{cmd} #{subc.name_args.ai} ... "
87
110
  unless @config[:dry_run]
88
111
  begin
89
112
  subc.run
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-chop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.15
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christo De Lange
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -139,7 +139,7 @@ dependencies:
139
139
  version: 11.10.0
140
140
  - - ~>
141
141
  - !ruby/object:Gem::Version
142
- version: '11.10'
142
+ version: '11.12'
143
143
  type: :runtime
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
@@ -149,7 +149,7 @@ dependencies:
149
149
  version: 11.10.0
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
- version: '11.10'
152
+ version: '11.12'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: unf
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -190,40 +190,6 @@ dependencies:
190
190
  - - ~>
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0.6'
193
- - !ruby/object:Gem::Dependency
194
- name: rspec
195
- requirement: !ruby/object:Gem::Requirement
196
- requirements:
197
- - - ! '>='
198
- - !ruby/object:Gem::Version
199
- version: 2.14.1
200
- - - ~>
201
- - !ruby/object:Gem::Version
202
- version: '2.14'
203
- type: :development
204
- prerelease: false
205
- version_requirements: !ruby/object:Gem::Requirement
206
- requirements:
207
- - - ! '>='
208
- - !ruby/object:Gem::Version
209
- version: 2.14.1
210
- - - ~>
211
- - !ruby/object:Gem::Version
212
- version: '2.14'
213
- - !ruby/object:Gem::Dependency
214
- name: jeweler
215
- requirement: !ruby/object:Gem::Requirement
216
- requirements:
217
- - - ! '>='
218
- - !ruby/object:Gem::Version
219
- version: 1.8.8
220
- type: :development
221
- prerelease: false
222
- version_requirements: !ruby/object:Gem::Requirement
223
- requirements:
224
- - - ! '>='
225
- - !ruby/object:Gem::Version
226
- version: 1.8.8
227
193
  description: Knife plugin to assist with the upload and sync of Chef server assets
228
194
  like roles, environments and cookbooks allowing for multiple parts to be uploaded
229
195
  at once to multiple environments. Resources can be matched with regular expressions.
@@ -244,6 +210,7 @@ files:
244
210
  - VERSION
245
211
  - bin/chop
246
212
  - knife-chop.gemspec
213
+ - knife-chop.iml
247
214
  - lib/chef/knife/chop/chef_data_bag_item.rb
248
215
  - lib/chef/knife/chop/chef_environment.rb
249
216
  - lib/chef/knife/chop/chef_knife.rb