def SetCoreGRRKnowledgeBaseValues(kb, client_obj):
 client_schema = client_obj.Schema
 kb.hostname = utils.SmartUnicode(client_obj.Get(client_schema.FQDN, ''))
 if (not kb.hostname):
  kb.hostname = utils.SmartUnicode(client_obj.Get(client_schema.HOSTNAME, ''))
 versions = client_obj.Get(client_schema.OS_VERSION)
 if (versions and versions.versions):
  kb.os_major_version = versions.versions[0]
  kb.os_minor_version = versions.versions[1]
 client_os = client_obj.Get(client_schema.SYSTEM)
 if client_os:
  kb.os = utils.SmartUnicode(client_obj.Get(client_schema.SYSTEM))

def SetCoreGRRKnowledgeBaseValues ( kb , client_obj ) : client_schema = client_obj . Schema kb . hostname = utils . SmartUnicode ( client_obj . Get ( client_schema . FQDN , '' ) ) if ( not kb . hostname ) : kb . hostname = utils . SmartUnicode ( client_obj . Get ( client_schema . HOSTNAME , '' ) ) versions = client_obj . Get ( client_schema . OS_VERSION ) if ( versions and versions . versions ) : kb . os_major_version = versions . versions [ 0 ] kb . os_minor_version = versions . versions [ 1 ] client_os = client_obj . Get ( client_schema . SYSTEM ) if client_os : kb . os = utils . SmartUnicode ( client_obj . Get ( client_schema . SYSTEM ) )
set core values from grr into the knowledgebase .