chef-busboy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef-busboy.rb +14 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7884a9199a8dcf57b9b3044aa6811f0617d8300b
4
- data.tar.gz: 10e96cecc9da5d48c6c80fe61bb1bdd8f2899648
3
+ metadata.gz: 4b40b3516b2bf5409f1bc5321f8fca808d6d94a1
4
+ data.tar.gz: 0f71ea9bbb5f2a6e8ebee05702e2e97a03872a60
5
5
  SHA512:
6
- metadata.gz: 07ef3d45ee8a623d0c53ef9323d177ccad14436da1c499ad6cd22e228977186958edabb3289b736e0907b98a75761e69c6378fb1c4ed599af4a1d7dc3d760222
7
- data.tar.gz: 4cf694bdbb20e305184dded9c37b723580eea80c5bc053d91af681967497f25ed9e49d0bb90c5c2c513483fe86ee32f2934d01f402845a391ccab731f926ee89
6
+ metadata.gz: ab6c4d9933a9991f5c5e0df595b375409d033d1d1bb945e0f9b674c58dbc2d140cd2a41baa64e0d9263ca1912cb65e3191717e26ea2f6e6b77d8705007d0821c
7
+ data.tar.gz: ae7af6a5cd4d15aa59d7b626448e1141078868503614d86c193f6154fe3f6978330909cb75974ce71364412523cae6b291ac98669067a078aa4eeb4c8b0c9d5b
data/lib/chef-busboy.rb CHANGED
@@ -20,8 +20,9 @@ class ChefBusBoy < Thor
20
20
  puts "Selections confirmed...updating run lists now..."
21
21
  results.each do |node|
22
22
  puts "Updating #{node.name}'s run list with #{options[:recipe_string]}"
23
- node.run_list << "#{options[:recipe_string]}"
24
- get_connection.node.update(node)
23
+ full_node = get_connection.node.find("#{node.name}")
24
+ full_node.run_list << "#{options[:recipe_string]}"
25
+ get_connection.node.update(full_node)
25
26
  end
26
27
  else
27
28
  puts "Transaction cancelled. Not updating any nodes"
@@ -41,10 +42,17 @@ class ChefBusBoy < Thor
41
42
  answer = get_user_confirmation("These are the nodes that matched your search and will be updated. Would you like to continue? y/n")
42
43
  if answer
43
44
  puts "Selections confirmed...updating environments now..."
45
+ count = 0
44
46
  results.each do |node|
45
47
  puts "Changing #{node.name}'s environment to #{options[:environment]}"
46
- node.chef_environment = "#{options[:environment]}"
47
- get_connection.node.update(node)
48
+ full_node = get_connection.node.find("#{node.name}")
49
+ full_node.chef_environment = "#{options[:environment]}"
50
+ @@chef_server.node.update(full_node)
51
+ count = count + 1
52
+ if count > 50
53
+ @@chef_server = nil
54
+ @@chef_server = get_connection
55
+ end
48
56
  end
49
57
  else
50
58
  puts "Transaction cancelled. Not updating any nodes"
@@ -72,7 +80,8 @@ class ChefBusBoy < Thor
72
80
 
73
81
  def search(string)
74
82
  chef_server = get_connection
75
- results = chef_server.partial_search(:node, "#{options[:search_string]}", "", {:rows => 5000})
83
+ results = chef_server.partial_search(:node, "#{options[:search_string]}", ["chef_environment", "run_list"], {:rows => 5000})
84
+ #results = chef_server.search(:node, "#{options[:search_string]}", {:rows => 5000})
76
85
  end
77
86
 
78
87
  def print_nodes(nodes)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-busboy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nolan Davidson