chef 0.9.8.beta.2 → 0.9.8.rc.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -184,6 +184,11 @@ class Chef
184
184
  @name_args = parse_options(argv)
185
185
  @name_args.reject! { |name_arg| command_name_words.delete(name_arg) }
186
186
 
187
+ # knife node run_list add requires that we have extra logic to handle
188
+ # the case that command name words could be joined by an underscore :/
189
+ command_name_words = command_name_words.join('_')
190
+ @name_args.reject! { |name_arg| command_name_words == name_arg }
191
+
187
192
  if config[:help]
188
193
  msg opt_parser
189
194
  exit 1
@@ -31,10 +31,15 @@ class Chef
31
31
  end
32
32
 
33
33
  def run
34
+ all_nodes = []
34
35
  Chef::Search::Query.new.search(:node, '*:*') do |node|
35
- current_time = DateTime.now
36
- date = DateTime.parse(Time.at(node["ohai_time"]).to_s)
37
- hours, minutes, seconds, frac = DateTime.day_fraction_to_time(current_time - date)
36
+ all_nodes << node
37
+ end
38
+ all_nodes.sort { |n1, n2| n1["ohai_time"] <=> n2["ohai_time"] }.each do |node|
39
+ # 59 seconds
40
+ # 1000 hours
41
+ # date = DateTime.parse(Time.at(node["ohai_time"]).to_s)
42
+ hours, minutes, seconds = time_difference_in_hms(node["ohai_time"])
38
43
  hours_text = "#{hours} hour#{hours == 1 ? ' ' : 's'}"
39
44
  minutes_text = "#{minutes} minute#{minutes == 1 ? ' ' : 's'}"
40
45
  if hours > 24
@@ -45,7 +50,21 @@ class Chef
45
50
  highline.say("<%= color('#{minutes_text}', GREEN) %> ago, #{node['fqdn']} checked in as a #{node['platform']} #{node['platform_version']} node.")
46
51
  end
47
52
  end
53
+
48
54
  end
55
+
56
+ # :nodoc:
57
+ # TODO: this is duplicated from StatusHelper in the Webui. dedup.
58
+ def time_difference_in_hms(unix_time)
59
+ now = Time.now.to_i
60
+ difference = now - unix_time.to_i
61
+ hours = (difference / 3600).to_i
62
+ difference = difference % 3600
63
+ minutes = (difference / 60).to_i
64
+ seconds = (difference % 60)
65
+ return [hours, minutes, seconds]
66
+ end
67
+
49
68
  end
50
69
  end
51
70
  end
@@ -17,5 +17,5 @@
17
17
 
18
18
  class Chef
19
19
  CHEF_ROOT = File.dirname(File.expand_path(File.dirname(__FILE__)))
20
- VERSION = '0.9.8.beta.2'
20
+ VERSION = '0.9.8.rc.0'
21
21
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 15424197
4
5
  prerelease: true
5
6
  segments:
6
7
  - 0
7
8
  - 9
8
9
  - 8
9
- - beta
10
- - 2
11
- version: 0.9.8.beta.2
10
+ - rc
11
+ - 0
12
+ version: 0.9.8.rc.0
12
13
  platform: ruby
13
14
  authors:
14
15
  - Adam Jacob
@@ -16,7 +17,7 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2010-07-29 00:00:00 -07:00
20
+ date: 2010-07-30 00:00:00 -07:00
20
21
  default_executable:
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
@@ -27,6 +28,7 @@ dependencies:
27
28
  requirements:
28
29
  - - ">="
29
30
  - !ruby/object:Gem::Version
31
+ hash: 19
30
32
  segments:
31
33
  - 1
32
34
  - 1
@@ -42,6 +44,7 @@ dependencies:
42
44
  requirements:
43
45
  - - ">="
44
46
  - !ruby/object:Gem::Version
47
+ hash: 19
45
48
  segments:
46
49
  - 1
47
50
  - 1
@@ -57,6 +60,7 @@ dependencies:
57
60
  requirements:
58
61
  - - ">="
59
62
  - !ruby/object:Gem::Version
63
+ hash: 19
60
64
  segments:
61
65
  - 1
62
66
  - 1
@@ -72,6 +76,7 @@ dependencies:
72
76
  requirements:
73
77
  - - ">="
74
78
  - !ruby/object:Gem::Version
79
+ hash: 19
75
80
  segments:
76
81
  - 1
77
82
  - 1
@@ -87,11 +92,12 @@ dependencies:
87
92
  requirements:
88
93
  - - ">="
89
94
  - !ruby/object:Gem::Version
95
+ hash: 7
90
96
  segments:
91
97
  - 0
92
98
  - 5
93
- - 0
94
- version: 0.5.0
99
+ - 6
100
+ version: 0.5.6
95
101
  type: :runtime
96
102
  version_requirements: *id005
97
103
  - !ruby/object:Gem::Dependency
@@ -102,6 +108,7 @@ dependencies:
102
108
  requirements:
103
109
  - - ">="
104
110
  - !ruby/object:Gem::Version
111
+ hash: 31
105
112
  segments:
106
113
  - 1
107
114
  - 0
@@ -109,6 +116,7 @@ dependencies:
109
116
  version: 1.0.4
110
117
  - - <=
111
118
  - !ruby/object:Gem::Version
119
+ hash: 1
112
120
  segments:
113
121
  - 1
114
122
  - 5
@@ -124,6 +132,7 @@ dependencies:
124
132
  requirements:
125
133
  - - ">="
126
134
  - !ruby/object:Gem::Version
135
+ hash: 7
127
136
  segments:
128
137
  - 0
129
138
  - 6
@@ -139,6 +148,7 @@ dependencies:
139
148
  requirements:
140
149
  - - <=
141
150
  - !ruby/object:Gem::Version
151
+ hash: 3
142
152
  segments:
143
153
  - 1
144
154
  - 4
@@ -154,6 +164,7 @@ dependencies:
154
164
  requirements:
155
165
  - - ">="
156
166
  - !ruby/object:Gem::Version
167
+ hash: 3
157
168
  segments:
158
169
  - 0
159
170
  version: "0"
@@ -167,6 +178,7 @@ dependencies:
167
178
  requirements:
168
179
  - - ">="
169
180
  - !ruby/object:Gem::Version
181
+ hash: 3
170
182
  segments:
171
183
  - 0
172
184
  version: "0"
@@ -180,6 +192,7 @@ dependencies:
180
192
  requirements:
181
193
  - - ">="
182
194
  - !ruby/object:Gem::Version
195
+ hash: 3
183
196
  segments:
184
197
  - 0
185
198
  version: "0"
@@ -193,6 +206,7 @@ dependencies:
193
206
  requirements:
194
207
  - - ">="
195
208
  - !ruby/object:Gem::Version
209
+ hash: 3
196
210
  segments:
197
211
  - 0
198
212
  version: "0"
@@ -206,6 +220,7 @@ dependencies:
206
220
  requirements:
207
221
  - - ">="
208
222
  - !ruby/object:Gem::Version
223
+ hash: 3
209
224
  segments:
210
225
  - 0
211
226
  version: "0"
@@ -574,6 +589,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
574
589
  requirements:
575
590
  - - ">="
576
591
  - !ruby/object:Gem::Version
592
+ hash: 3
577
593
  segments:
578
594
  - 0
579
595
  version: "0"
@@ -582,6 +598,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
582
598
  requirements:
583
599
  - - ">"
584
600
  - !ruby/object:Gem::Version
601
+ hash: 25
585
602
  segments:
586
603
  - 1
587
604
  - 3