knife-push 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bebb71782611b283606a810b94bf56c64e3898af
4
+ data.tar.gz: 8a5cb91fe70c8ff5956c8238f4c7d34a8f6e2b9b
5
+ SHA512:
6
+ metadata.gz: f451dd991e86ad803de51bed3ce7d7bb8134cbed5f475d91097df70994674b8e9b3563f70d26318b1aed487ed5fc78c6d431fe953e09ff0e74d27aa5bf42da03
7
+ data.tar.gz: bb7516272bfdec9fc8d00936af15a14aee5f02277359c2c847ec08072c0222322894f20ec64725d9733f6a2fb77d678082a38f6c92e51add9f2afb68fea58834
@@ -45,6 +45,14 @@ class Chef
45
45
 
46
46
  def run
47
47
  @node_names = []
48
+
49
+ job_name = @name_args[0]
50
+ if job_name.nil?
51
+ ui.error "No job specified."
52
+ show_usage
53
+ exit 1
54
+ end
55
+
48
56
  if config[:search]
49
57
  q = Chef::Search::Query.new
50
58
  @escaped_query = URI.escape(config[:search],
@@ -61,10 +69,15 @@ class Chef
61
69
  @node_names = name_args[1,name_args.length-1]
62
70
  end
63
71
 
72
+ if @node_names.empty?
73
+ ui.error "No nodes to run job on. Specify nodes as arguments or use -s to specify a search query."
74
+ exit 1
75
+ end
76
+
64
77
  rest = Chef::REST.new(Chef::Config[:chef_server_url])
65
78
 
66
79
  job_json = {
67
- 'command' => name_args[0],
80
+ 'command' => job_name,
68
81
  'nodes' => @node_names,
69
82
  'quorum' => get_quorum(config[:quorum], @node_names.length)
70
83
  }
@@ -138,4 +151,3 @@ class Chef
138
151
  end
139
152
  end
140
153
  end
141
-
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Push
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-push
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
5
- prerelease:
4
+ version: 0.5.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - John Keiser
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: chef
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 11.10.4
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: 11.10.4
30
27
  description: Knife plugin for OPC push
@@ -45,27 +42,25 @@ files:
45
42
  - lib/knife-push/version.rb
46
43
  homepage: http://www.opscode.com
47
44
  licenses: []
45
+ metadata: {}
48
46
  post_install_message:
49
47
  rdoc_options: []
50
48
  require_paths:
51
49
  - lib
52
50
  required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
51
  requirements:
55
- - - ! '>='
52
+ - - ">="
56
53
  - !ruby/object:Gem::Version
57
54
  version: '0'
58
55
  required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
56
  requirements:
61
- - - ! '>='
57
+ - - ">="
62
58
  - !ruby/object:Gem::Version
63
59
  version: '0'
64
60
  requirements: []
65
61
  rubyforge_project:
66
- rubygems_version: 1.8.23
62
+ rubygems_version: 2.2.2
67
63
  signing_key:
68
- specification_version: 3
64
+ specification_version: 4
69
65
  summary: Knife plugin for OPC push
70
66
  test_files: []
71
- has_rdoc: true