def set_data(self, new_data):
        """Serialize and persist new data to ZK.

        Args:
            new_value: The new json config
        Returns:
            True if update succeeds, False otherwise

        """
        try:
            old_data = self.get_data()
            serialized_data = json.dumps(old_data, cls=self.encoder_cls, sort_keys=True) if old_data else ''
            serialized_new_data = json.dumps(new_data, cls=self.encoder_cls, sort_keys=True) if new_data else ''
        except __HOLE__:
            log.error("Error JSON-serializing data for managed data config")
            log.error(self.get_data())
            log.error(new_data)
            return False

        return self.zk_config_manager.update_zk(
            serialized_data, serialized_new_data, self.force_config_update)
dataset/ETHPy150Open pinterest/kingpin/kingpin/manageddata/managed_datastructures.py/ManagedJsonSerializableDataConfig.set_data