From e9db6c46fc23f73e878e2ad0d6a539080d3e7c4a Mon Sep 17 00:00:00 2001 From: David Lehman Date: Wed, 9 Apr 2014 14:01:30 -0400 Subject: [PATCH 06/13] Handle the case of md arrays getting activated from outside blivet. Wiping signatures from a partition on a disk that contains an md member causes a change uevent, which causes the md array to get activated via udev. We must be able to cope with these arrays getting activated from outside while processing actions. --- blivet/devices.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/blivet/devices.py b/blivet/devices.py index 4dc4ee4..0cae2c2 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -3434,7 +3434,9 @@ class MDRaidArrayDevice(ContainerDevice): def updateSysfsPath(self): """ Update this device's sysfs path. """ - log_method_call(self, self.name, status=self.status) + # don't include self.status here since this method is called by + # MDRaidArrayDevice.status + log_method_call(self, self.name) if not self.exists: raise errors.DeviceError("device has not been created", self.name) @@ -3497,6 +3499,10 @@ class MDRaidArrayDevice(ContainerDevice): if not self.exists: return status + if os.path.exists(self.path): + # FIXME: verify that the thing at this path has our UUID + self.updateSysfsPath() + state_file = "/sys/%s/md/array_state" % self.sysfsPath try: state = open(state_file).read().strip() -- 1.9.0