---
blivet/devicefactory.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index 5f3604a..d759aa0 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -381,11 +381,10 @@ class DeviceFactory(object):
elif hasattr(device, "volume"):
container = device.volume
elif name:
- container = self.storage.devicetree.getDeviceByName(name)
- if container and container not in self.container_list:
- log.debug("specified container name %s is wrong type (%s)"
- % (name, container.type))
- container = None
+ for c in self.storage.devices:
+ if c.name == name and c in self.container_list:
+ container = c
+ break
else:
containers = [c for c in self.container_list
if allow_existing or not c.exists]
--
1.8.1.4