def setOs():
 infoMsg = ''
 if (not kb.bannerFp):
  return
 if ('type' in kb.bannerFp):
  Backend.setOs(Format.humanize(kb.bannerFp['type']))
  infoMsg = ('the back-end DBMS operating system is %s' % Backend.getOs())
 if ('distrib' in kb.bannerFp):
  kb.osVersion = Format.humanize(kb.bannerFp['distrib'])
  infoMsg += (' %s' % kb.osVersion)
 if ('sp' in kb.bannerFp):
  kb.osSP = int(Format.humanize(kb.bannerFp['sp']).replace('Service Pack ', ''))
 elif (('sp' not in kb.bannerFp) and Backend.isOs(OS.WINDOWS)):
  kb.osSP = 0
 if (Backend.getOs() and kb.osVersion and kb.osSP):
  infoMsg += (' Service Pack %d' % kb.osSP)
 if infoMsg:
  logger.info(infoMsg)
 hashDBWrite(HASHDB_KEYS.OS, Backend.getOs())

def setOs ( ) : infoMsg = '' if ( not kb . bannerFp ) : return if ( 'type' in kb . bannerFp ) : Backend . setOs ( Format . humanize ( kb . bannerFp [ 'type' ] ) ) infoMsg = ( 'the back-end DBMS operating system is %s' % Backend . getOs ( ) ) if ( 'distrib' in kb . bannerFp ) : kb . osVersion = Format . humanize ( kb . bannerFp [ 'distrib' ] ) infoMsg += ( ' %s' % kb . osVersion ) if ( 'sp' in kb . bannerFp ) : kb . osSP = int ( Format . humanize ( kb . bannerFp [ 'sp' ] ) . replace ( 'Service Pack ' , '' ) ) elif ( ( 'sp' not in kb . bannerFp ) and Backend . isOs ( OS . WINDOWS ) ) : kb . osSP = 0 if ( Backend . getOs ( ) and kb . osVersion and kb . osSP ) : infoMsg += ( ' Service Pack %d' % kb . osSP ) if infoMsg : logger . info ( infoMsg ) hashDBWrite ( HASHDB_KEYS . OS , Backend . getOs ( ) )
example of kb .