puppet_agent_mgr 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,17 +33,19 @@ module PuppetAgentMgr
33
33
  end
34
34
 
35
35
  def run_in_foreground(clioptions, execute=true)
36
- command =["puppet", "agent", "--test", "--color=false"]
37
- command.concat(clioptions)
36
+ options = ["--test", "--color=false"].concat(clioptions)
38
37
 
39
- %x[#{command.join(' ')}]
38
+ return options unless execute
39
+
40
+ %x[puppet agent #{options.join(' ')}]
40
41
  end
41
42
 
42
43
  def run_in_background(clioptions, execute=true)
43
- command =["puppet", "agent", "--onetime", "--daemonize", "--color=false"]
44
- command.concat(clioptions)
44
+ options =["--onetime", "--daemonize", "--color=false"].concat(clioptions)
45
+
46
+ return options unless execute
45
47
 
46
- %x[#{command.join(' ')}]
48
+ %x[puppet agent #{options.join(' ')}]
47
49
  end
48
50
 
49
51
  def validate_name(name)
@@ -128,14 +130,14 @@ module PuppetAgentMgr
128
130
  end
129
131
 
130
132
  if foreground_run
131
- return :foreground_run, clioptions if options[:options_only]
133
+ return :foreground_run, run_in_foreground(clioptions, false) if options[:options_only]
132
134
  return run_in_foreground(clioptions)
133
135
  elsif idling? && signal_daemon
134
136
  return :signal_running_daemon, clioptions if options[:options_only]
135
137
  return signal_running_daemon
136
138
  else
137
139
  raise "Cannot run in the background if the daemon is present" if daemon_present?
138
- return :run_in_background, clioptions if options[:options_only]
140
+ return :run_in_background, run_in_background(clioptions, false) if options[:options_only]
139
141
  return run_in_background(clioptions)
140
142
  end
141
143
  end
@@ -1,3 +1,3 @@
1
1
  module PuppetAgentMgr
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
9
+ - 7
10
+ version: 0.0.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - R.I.Pienaar