def _update_squashed_layer_metadata(self, old_json_file, squashed_dir):
        image_id = self._generate_image_id()

        metadata = self._read_old_metadata(old_json_file)

        # Modify common metadata fields
        if self.squash_id:
            metadata['config']['Image'] = self.squash_id
        else:
            metadata['config'].pop('Image', None)

        metadata['created'] = self.date

        # Remove unnecessary fields
        del metadata['container_config']
        del metadata['container']
        del metadata['config']['Hostname']

        if self.squash_id:
            metadata['parent'] = self.squash_id
        else:
            metadata.pop('parent', None)

        metadata['id'] = image_id
        metadata['Size'] = os.path.getsize(
            os.path.join(squashed_dir, "layer.tar"))
        json_metadata = self._dump_json(metadata)[0]

        self._write_json_metadata(
            json_metadata % "%s", os.path.join(squashed_dir, "json"))

        return image_id
dataset/ETHPy150Open goldmann/docker-squash/docker_squash/v1_image.py/V1Image._update_squashed_layer_metadata/swapped operands of `%`