python-blivet/0001-Invalidate-LVM-caches-in-blivet-device-discovery-loop.patch

42 lines
1.3 KiB
Diff

From 394ff40554ab8b3ce9ff0aa5af0c8c2ead6522a3 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Mon, 20 Apr 2020 11:01:10 -0700
Subject: [PATCH] Invalidate LVM caches in blivet device discovery loop
(#1824418)
This should work around a problem where we sometimes fail to
correctly evaluate existing logical volumes, though it is not a
correct fix for the underlying problem (which we haven't exactly
identified yet) but a workaround for Fedora 32 release.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
blivet/populator/populator.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py
index 465c272d..3e1d16f3 100644
--- a/blivet/populator/populator.py
+++ b/blivet/populator/populator.py
@@ -24,6 +24,7 @@ import os
import pprint
import copy
import parted
+import time
from six import add_metaclass
import gi
@@ -454,6 +455,9 @@ class PopulatorMixin(object):
callbacks.populate_started(n_devices=n_devices)
report = False
+ time.sleep(2)
+ self.drop_lvm_cache()
+ mpath_members.drop_cache()
log.info("devices to scan: %s", [udev.device_get_name(d) for d in devices])
for dev in devices:
self.handle_device(dev)
--
2.26.1