Created
October 18, 2012 01:15
-
-
Save zippyz/3909323 to your computer and use it in GitHub Desktop.
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
import os,sys,logging | |
#logging.basicConfig(level=logging.DEBUG) | |
#TODO this is currently not working, need to fix returning grain | |
def file_get_contents(filename): | |
content = "" | |
if os.path.exists(filename): | |
fp = open(filename, "r") | |
content = fp.read() | |
fp.close() | |
return content | |
# Provides: | |
# osrelease | |
# oscodename | |
def return_grains(): | |
grains = {} | |
filename = "/environment" | |
#grains = file_get_contents(filename) | |
grains['env_grain'] = file_get_contents(filename) | |
if 'env_grain': | |
return grains | |
return {} | |
def main(): | |
return_grains() | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment