def get_lus_version():
 fsvers = '/proc/fs/lustre/version'
 logging.debug((' opening file ' + fsvers))
 try:
  fobj = open(fsvers)
 except IOError:
  logging.debug(('ERROR opening file ' + fsvers))
  exit()
 vals = []
 for line in fobj:
  item = re.split('\\s+', line.rstrip())
  vals.append(item)
 for n in range(len(vals)):
  if ('lustre:' in vals[n]):
   vers_string = vals[n][1]
   fir = vers_string.find('.')
   sec = vers_string.find('.', (fir + 1))
   lus_version = ((vers_string[0:fir] + '.') + vers_string[(fir + 1):sec])
 logging.debug((' lus_version: ' + str(lus_version)))
 return float(lus_version)

def get_lus_version ( ) : fsvers = '/proc/fs/lustre/version' logging . debug ( ( ' opening file ' + fsvers ) ) try : fobj = open ( fsvers ) except IOError : logging . debug ( ( 'ERROR opening file ' + fsvers ) ) exit ( ) vals = [ ] for line in fobj : item = re . split ( '\\s+' , line . rstrip ( ) ) vals . append ( item ) for n in range ( len ( vals ) ) : if ( 'lustre:' in vals [ n ] ) : vers_string = vals [ n ] [ 1 ] fir = vers_string . find ( '.' ) sec = vers_string . find ( '.' , ( fir + 1 ) ) lus_version = ( ( vers_string [ 0 : fir ] + '.' ) + vers_string [ ( fir + 1 ) : sec ] ) logging . debug ( ( ' lus_version: ' + str ( lus_version ) ) ) return float ( lus_version )
return lustre version number .