lvmstrap: add more excluded FS types
authorIustin Pop <iustin@google.com>
Wed, 19 Jan 2011 11:10:36 +0000 (12:10 +0100)
committerIustin Pop <iustin@google.com>
Thu, 20 Jan 2011 12:05:37 +0000 (13:05 +0100)
Also moves the list of excluded types to the top level and make it a
frozenset.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

tools/lvmstrap

index 7e8f85c..1cc746d 100755 (executable)
@@ -66,6 +66,18 @@ SUPPORTED_TYPES = [
   "ubd",
   ]
 
+#: Excluded filesystem types
+EXCLUDED_FS = frozenset([
+  "nfs",
+  "nfs4",
+  "autofs",
+  "tmpfs",
+  "proc",
+  "sysfs",
+  "usbfs",
+  "devpts",
+  ])
+
 
 class Error(Exception):
   """Generic exception"""
@@ -460,7 +472,7 @@ def GetMountInfo():
   for line in mountlines:
     _, mountpoint, fstype, _ = line.split(None, 3)
     # fs type blacklist
-    if fstype in ["nfs", "nfs4", "autofs", "tmpfs", "proc", "sysfs"]:
+    if fstype in EXCLUDED_FS:
       continue
     try:
       dev = os.stat(mountpoint).st_dev