omnibus-ctl 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f727fad81d619b5de76e830757918590df8b636
4
- data.tar.gz: 2a606b930145058c04f31a36f14ff4f32f1d1449
3
+ metadata.gz: 443379da47208384a63e0fc8e382cd03646e9083
4
+ data.tar.gz: 221bd434c9d7ba7da741582343a4ac16a52dc61f
5
5
  SHA512:
6
- metadata.gz: ed89feaa9a4cfedb22f06640efd44644f1908cc6c254ba19185e41e144d722006855cb57c451c86e293448a3269ecae36acf725948cab7f83539df0e01aec4f7
7
- data.tar.gz: 4627bd21c3569788abdca489e4d94096d847861fbfee83f35eb9cbbaeb67e29c4859dd5e67507ad8e94fe9d4f849d4ccee3a805aac8ab9ff6830263b37c57a21
6
+ metadata.gz: e24c6610b8b2f7d09d0094b9c172c501de14a46e537d2bdb0bed5768c6caf4a7d429143936c1d10ea4c28881205d2e4dcdcee197f9b503b9b308aaa61ec5d3df
7
+ data.tar.gz: 53d26b2824c01bdeddde2cf75418fa8fe8d549f5ae22878dad90bfe7014536163591559563311e5f37a30705f45edb6efbc9ef6a3f5a8540f17804111ae572cb
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## omnibus-ctl
2
2
 
3
+ [![Build Status Master](https://travis-ci.org/chef/omnibus-ctl.svg?branch=master)](https://travis-ci.org/chef/omnibus-ctl)
4
+
3
5
  omnibus-ctl provides service control and configuration for omnibus packages.
4
6
 
5
7
  Not much to see here yet.
data/lib/omnibus-ctl.rb CHANGED
@@ -155,10 +155,14 @@ module Omnibus
155
155
 
156
156
  def load_files(path)
157
157
  Dir["#{path}/*.rb"].each do |file|
158
- eval(IO.read(file))
158
+ load_file(file)
159
159
  end
160
160
  end
161
161
 
162
+ def load_file(filepath)
163
+ eval(IO.read(filepath))
164
+ end
165
+
162
166
  def add_command(name, description, arity=1, &block)
163
167
  @command_map[name] = { :desc => description, :arity => arity }
164
168
  metaclass = class << self; self; end
@@ -385,8 +389,24 @@ module Omnibus
385
389
  end
386
390
  end
387
391
 
392
+ def remove_old_node_state
393
+ node_cache_path = "#{base_path}/embedded/nodes/"
394
+ status = run_command("rm -rf #{node_cache_path}")
395
+ if ! status.success?
396
+ log "Could not remove cached node state!"
397
+ exit! 1
398
+ end
399
+ end
400
+
401
+ def run_chef(attr_location, args='')
402
+ remove_old_node_state
403
+ cmd = "#{base_path}/embedded/bin/chef-client -z -c #{base_path}/embedded/cookbooks/solo.rb -j #{attr_location}"
404
+ cmd += " #{args}" unless args.empty?
405
+ run_command(cmd)
406
+ end
407
+
388
408
  def show_config(*args)
389
- status = run_command("#{base_path}/embedded/bin/chef-client -z -c #{base_path}/embedded/cookbooks/solo.rb -j #{base_path}/embedded/cookbooks/show-config.json -l fatal")
409
+ status = run_chef("#{base_path}/embedded/cookbooks/show-config.json", "-l fatal")
390
410
  if status.success?
391
411
  exit! 0
392
412
  else
@@ -395,7 +415,7 @@ module Omnibus
395
415
  end
396
416
 
397
417
  def reconfigure(exit_on_success=true)
398
- status = run_command("#{base_path}/embedded/bin/chef-client -z -c #{base_path}/embedded/cookbooks/solo.rb -j #{base_path}/embedded/cookbooks/dna.json")
418
+ status = run_chef("#{base_path}/embedded/cookbooks/dna.json")
399
419
  if status.success?
400
420
  log "#{display_name} Reconfigured!"
401
421
  exit! 0 if exit_on_success
@@ -1,5 +1,5 @@
1
1
  module Omnibus
2
2
  class Ctl
3
- VERSION = "0.3.3"
3
+ VERSION = "0.3.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus-ctl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Opscode, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-06 00:00:00.000000000 Z
11
+ date: 2015-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '3.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '3.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec_junit_formatter
29
29
  requirement: !ruby/object:Gem::Requirement