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

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