knife-stalenodes 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/stalenodes.rb +8 -1
- data/lib/knife-stalenodes/version.rb +3 -2
- metadata +1 -1
@@ -57,6 +57,12 @@ module KnifeStalenodes
|
|
57
57
|
:description => "Adds minutes to hours since last check in",
|
58
58
|
:default => 0
|
59
59
|
|
60
|
+
option :maxhost,
|
61
|
+
:short => "-n HOSTS",
|
62
|
+
:long => "--number HOSTS",
|
63
|
+
:description => "Max number of hosts to search",
|
64
|
+
:default => 2500
|
65
|
+
|
60
66
|
|
61
67
|
def calculate_time
|
62
68
|
seconds = config[:days].to_i * 86400 + config[:hours].to_i * 3600 + config[:minutes].to_i * 60
|
@@ -101,7 +107,8 @@ module KnifeStalenodes
|
|
101
107
|
search_args = { :keys => {
|
102
108
|
:ohai_time => ['ohai_time'],
|
103
109
|
:name => ['name']
|
104
|
-
}
|
110
|
+
},
|
111
|
+
:rows => config[:maxhost]
|
105
112
|
}
|
106
113
|
|
107
114
|
query.search(:node, get_query, search_args).first.each do |node|
|