Created
June 21, 2019 21:24
-
-
Save runswithd6s/5065b25c5952b61aed5f2ee52c17bc1f to your computer and use it in GitHub Desktop.
Saltstack grain for SugarCRM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import os | |
def sugar_app(): | |
""" | |
Set version information about sugar, if /vol/sugar_pro/sugar_version.json is available | |
:return: dict | |
""" | |
# Update this path to match your SugarCRM installation | |
json_path="/vol/sugar_pro/sugar_version.json" | |
grains = {} | |
if not os.path.isfile(json_path): | |
return grains | |
with open(json_path,'r') as version_file: | |
info = json.loads(version_file.read()) | |
for key in info: | |
grains[key] = info[key] | |
return grains |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment