def NginxGrains():
 grains = {}
 max_open_file = 65536
 try:
  getulimit = commands.getstatusoutput('source /etc/profile;ulimit -n')
 except Exception as e:
  pass
 if (getulimit[0] == 0):
  max_open_file = int(getulimit[1])
 grains['max_open_file'] = max_open_file
 return grains

def NginxGrains ( ) : grains = { } max_open_file = 65536 try : getulimit = commands . getstatusoutput ( 'source /etc/profile;ulimit -n' ) except Exception as e : pass if ( getulimit [ 0 ] == 0 ) : max_open_file = int ( getulimit [ 1 ] ) grains [ 'max_open_file' ] = max_open_file return grains
return nginx config grains value .