'Generates the client config file for inclusion in deployable binaries.'

def GetClientConfig(self, context, validate=True, deploy_timestamp=True):

    with utils.TempDirectory() as tmp_dir:
        filename = os.path.join(tmp_dir, config.CONFIG.Get('ClientBuilder.config_filename', context=context))
        new_config = config.CONFIG.MakeNewConfig()
        new_config.Initialize(reset=True, data='')
        new_config.SetWriteBack(filename)
        for descriptor in sorted(config.CONFIG.type_infos, key=(lambda x: x.name)):
            if (descriptor.name in self.SKIP_OPTION_LIST):
                continue
            if (descriptor.section in self.CONFIG_SECTIONS):
                value = config.CONFIG.GetRaw(descriptor.name, context=context, default=None)
                if (value is not None):
                    logging.debug('Copying    config    option    to    client:    %s', descriptor.name)
                    new_config.SetRaw(descriptor.name, value)
        if deploy_timestamp:
            new_config.Set('Client.deploy_time', str(rdfvalue.RDFDatetime.Now()))
        new_config.Write()
        if validate:
            self.ValidateEndConfig(new_config)
        private_validator = config.CONFIG.Get('ClientBuilder.private_config_validator_class', context=context)
        if private_validator:
            try:
                validator = PrivateConfigValidator.classes[private_validator]()
            except KeyError:
                logging.error("Couldn't    find    config    validator    class    %s,    you    probably    need    to    copy    it    into    lib/local", private_validator)
                raise
            validator.ValidateEndConfig(new_config, self.context)
        return open(filename, 'rb').read()
