summaryrefslogtreecommitdiffstats
path: root/storage/udev.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2009-03-19 13:57:14 -0400
committerJeremy Katz <katzj@redhat.com>2009-03-19 13:57:14 -0400
commit8e9e908f53c6c1124cfda9acb70c8d3e465e9fd8 (patch)
treec00f674052a0e009ad609ec1a59c086302029f67 /storage/udev.py
parent582dfa9e781a172765b5c2f9ce770a41bac77e68 (diff)
downloadanaconda-8e9e908f53c6c1124cfda9acb70c8d3e465e9fd8.tar.gz
anaconda-8e9e908f53c6c1124cfda9acb70c8d3e465e9fd8.tar.xz
anaconda-8e9e908f53c6c1124cfda9acb70c8d3e465e9fd8.zip
Move blockdev blacklisting to be a function
Diffstat (limited to 'storage/udev.py')
-rw-r--r--storage/udev.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/storage/udev.py b/storage/udev.py
index a6d3190cb..e8e824698 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -39,11 +39,18 @@ def udev_get_block_devices():
entries.append(entry)
return entries
+def __is_blacklisted_blockdev(dev_name):
+ """Is this a blockdev we never want for an install?"""
+ if dev_name.startswith("loop") or dev_name.startswith("ram"):
+ return True
+
+ return False
+
def enumerate_block_devices():
top_dir = "/sys/class/block"
devices = []
for dev_name in os.listdir(top_dir):
- if dev_name.startswith("loop") or dev_name.startswith("ram"):
+ if __is_blacklisted_blockdev(dev_name):
continue
full_path = os.path.join(top_dir, dev_name)
link_ref = os.readlink(full_path)