Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect platform, fail if it's not linux #50

Merged
merged 1 commit into from Oct 4, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1478,6 +1478,15 @@ def parse_options():
(options, args) = parser.parse_args()
return options

def assert_os():
platform = sys.platform
# maybe also allow freebsd or sunos?
if not platform.startswith('linux'):
printLog("This script is only designed to run under linux, not %s" %
platform)
log({"platform": platform})
sys.exit(1)

# Script starts here
def main():
try:
@@ -1498,6 +1507,7 @@ def main():
"operating_system": current_environment['operating_system'],
"syslog_versions": [ {"daemon": d, "version": v} for d,v in current_environment['syslog_versions'] ]
})
assert_os()
call_module(options.action, current_environment)
printMessage("Finished")
log({"status":"finish", "args": vars(options)})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.