'Stores information about the platform.'

@flow.StateHandler()
def Platform(self, responses):

    if responses.success:
        response = responses.First()
        with self._OpenClient(mode='rw') as client:
            client.Set(client.Schema.HOSTNAME(response.node))
            client.Set(client.Schema.SYSTEM(response.system))
            client.Set(client.Schema.OS_RELEASE(response.release))
            client.Set(client.Schema.OS_VERSION(response.version))
            client.Set(client.Schema.KERNEL(response.kernel))
            client.Set(client.Schema.FQDN(response.fqdn))
            client.Set(client.Schema.ARCH(response.machine))
            client.Set(client.Schema.UNAME(('%s-%s-%s' % (response.system, response.release, response.version))))
            client_index.CreateClientIndex(token=self.token).AddClient(client)
        if (response.system == 'Windows'):
            with aff4.FACTORY.Create(self.client_id.Add('registry'), standard.VFSDirectory, token=self.token) as fd:
                fd.Set(fd.Schema.PATHSPEC, fd.Schema.PATHSPEC(path='/', pathtype=rdf_paths.PathSpec.PathType.REGISTRY))
        if (response.system in ['Linux', 'Windows']):
            self.CallClient(server_stubs.GetCloudVMMetadata, cloud.BuildCloudMetadataRequests(), next_state='CloudMetadata')
        known_system_type = True
    else:
        client = self._OpenClient()
        known_system_type = client.Get(client.Schema.SYSTEM)
        self.Log('Could    not    retrieve    Platform    info.')
    if known_system_type:
        self.CallFlow(artifact.KnowledgeBaseInitializationFlow.__name__, require_complete=False, lightweight=self.args.lightweight, next_state='ProcessKnowledgeBase')
    else:
        self.Log('Unknown    system    type,    skipping    KnowledgeBaseInitializationFlow')
