summaryrefslogtreecommitdiff
path: root/bin/puppet_command
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-10 14:48:26 -0400
committerMicah <micah@leap.se>2016-05-10 14:48:26 -0400
commit86c85582065c391aa13c0b9b397dfd1aa2e2ac7b (patch)
tree7c027409a517d862864bf3650f4a8a66f615162d /bin/puppet_command
parent70b1c648b94e6c007b9241a4661f33881e74485f (diff)
parent66b4c6b5ec6fe2f242020845fe92715ae2cdcc1e (diff)
Merge tag '0.8.0'
Release 0.8.0
Diffstat (limited to 'bin/puppet_command')
-rwxr-xr-xbin/puppet_command14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/puppet_command b/bin/puppet_command
index 1e74522a..eb3cd0b9 100755
--- a/bin/puppet_command
+++ b/bin/puppet_command
@@ -13,6 +13,7 @@ require 'logger'
require 'socket'
require 'fileutils'
+DEBIAN_VERSION = /^(jessie|8\.)/
PUPPET_BIN = '/usr/bin/puppet'
PUPPET_DIRECTORY = '/srv/leap'
PUPPET_PARAMETERS = '--color=false --detailed-exitcodes --libdir=puppet/lib --confdir=puppet'
@@ -28,7 +29,12 @@ SUMMARY_LOG_1 = '/var/log/leap/deploy-summary.log.1'
APPLY_START_STR = "STARTING APPLY"
APPLY_FINISH_STR = "APPLY COMPLETE"
+
def main
+ if File.read('/etc/debian_version') !~ DEBIAN_VERSION
+ log "ERROR: This operating system is not supported. The file /etc/debian_version must match #{DEBIAN_VERSION}."
+ exit 1
+ end
process_command_line_arguments
with_lockfile do
@commands.each do |command|
@@ -58,9 +64,11 @@ def log(str, *args)
str = str.strip
$stdout.puts str
$stdout.flush
- $logger.info(str)
- if args.include? :summary
- $summary_logger.info(str)
+ if $logger
+ $logger.info(str)
+ if args.include? :summary
+ $summary_logger.info(str)
+ end
end
end