Skip to content

Instantly share code, notes, and snippets.

@runswithd6s
Created June 21, 2019 21:24
Show Gist options
  • Save runswithd6s/5065b25c5952b61aed5f2ee52c17bc1f to your computer and use it in GitHub Desktop.
Save runswithd6s/5065b25c5952b61aed5f2ee52c17bc1f to your computer and use it in GitHub Desktop.
Saltstack grain for SugarCRM
#!/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