summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-17 21:27:26 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-09-17 21:27:26 +0000
commita345931bccd2809aee35dcdaf6a3ef1d21db8c26 (patch)
treef2b8bbf7006f162f0fb19a4e3398b38dae9ea010 /bin
parenta8bdada4acadd2d5c0a08dd1c9d1a4fe5232e061 (diff)
Successfully parsed my entire converted cfengine configuration; these are all fixes for bugs i found as a result. I have not tried to execute the configuration yet.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@687 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin')
-rwxr-xr-xbin/puppet20
1 files changed, 18 insertions, 2 deletions
diff --git a/bin/puppet b/bin/puppet
index cf70a93de..a6bf90c61 100755
--- a/bin/puppet
+++ b/bin/puppet
@@ -8,7 +8,7 @@
# = Usage
#
# puppet [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
-# [-l|--logfile <file>] <file>
+# [-l|--logfile <file>] [-p|--parse-only] <file>
#
# = Description
#
@@ -28,6 +28,12 @@
# Where to send messages. Choose between syslog, the console, and a log file.
# Defaults to sending messages to the console.
#
+# parse-only::
+# Just verify syntax, do not apply anything.
+#
+# verbose::
+# Print extra information.
+#
# = Example
#
# puppet -l /tmp/script.log script.pp
@@ -59,12 +65,14 @@ result = GetoptLong.new(
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ],
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
+ [ "--parse-only", "-p", GetoptLong::NO_ARGUMENT ],
[ "--version", "-V", GetoptLong::NO_ARGUMENT ]
)
debug = false
verbose = false
logfile = false
+parseonly = false
begin
result.each { |opt,arg|
@@ -81,6 +89,8 @@ begin
end
when "--verbose"
verbose = true
+ when "--parse-only"
+ parseonly = true
when "--debug"
debug = true
when "--logdest"
@@ -119,13 +129,19 @@ end
begin
client = Puppet::Client::MasterClient.new(
- :Master => server
+ :Master => server,
+ :Cache => false
)
rescue => detail
$stderr.puts detail
exit(1)
end
+
+if parseonly
+ exit(0)
+end
+
begin
client.getconfig
client.apply