puppet_agent_mgr 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,14 +32,14 @@ module PuppetAgentMgr
32
32
  managed_resources.size
33
33
  end
34
34
 
35
- def run_in_foreground(clioptions)
35
+ def run_in_foreground(clioptions, execute=true)
36
36
  command =["puppet", "agent", "--test", "--color=false"]
37
37
  command.concat(clioptions)
38
38
 
39
39
  %x[#{command.join(' ')}]
40
40
  end
41
41
 
42
- def run_in_background(clioptions)
42
+ def run_in_background(clioptions, execute=true)
43
43
  command =["puppet", "agent", "--onetime", "--daemonize", "--color=false"]
44
44
  command.concat(clioptions)
45
45
 
@@ -103,7 +103,7 @@ module PuppetAgentMgr
103
103
  # else a single background run will be attempted but this will fail if a idling
104
104
  # daemon is present and :signal_daemon was false
105
105
  def runonce!(options={})
106
- valid_options = [:noop, :signal_daemon, :foreground_run, :tags, :environment, :server, :splay, :splaylimit]
106
+ valid_options = [:noop, :signal_daemon, :foreground_run, :tags, :environment, :server, :splay, :splaylimit, :options_only]
107
107
 
108
108
  options.keys.each do |opt|
109
109
  raise("Unknown option %s specified" % opt) unless valid_options.include?(opt)
@@ -128,12 +128,15 @@ module PuppetAgentMgr
128
128
  end
129
129
 
130
130
  if foreground_run
131
- run_in_foreground(clioptions)
131
+ return :foreground_run, clioptions if options[:options_only]
132
+ return run_in_foreground(clioptions)
132
133
  elsif idling? && signal_daemon
133
- signal_running_daemon
134
+ return :signal_running_daemon, clioptions if options[:options_only]
135
+ return signal_running_daemon
134
136
  else
135
137
  raise "Cannot run in the background if the daemon is present" if daemon_present?
136
- run_in_background(clioptions)
138
+ return :run_in_background, clioptions if options[:options_only]
139
+ return run_in_background(clioptions)
137
140
  end
138
141
  end
139
142
 
@@ -1,3 +1,3 @@
1
1
  module PuppetAgentMgr
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_agent_mgr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-28 00:00:00 +01:00
18
+ date: 2012-09-29 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency