puppet_agent_mgr 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/puppet_agent_mgr/common.rb +10 -8
- data/lib/puppet_agent_mgr/version.rb +1 -1
- metadata +3 -3
@@ -33,17 +33,19 @@ module PuppetAgentMgr
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def run_in_foreground(clioptions, execute=true)
|
36
|
-
|
37
|
-
command.concat(clioptions)
|
36
|
+
options = ["--test", "--color=false"].concat(clioptions)
|
38
37
|
|
39
|
-
|
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
|
-
|
44
|
-
|
44
|
+
options =["--onetime", "--daemonize", "--color=false"].concat(clioptions)
|
45
|
+
|
46
|
+
return options unless execute
|
45
47
|
|
46
|
-
%x[#{
|
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
|
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:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- R.I.Pienaar
|