From 6714256cfaac44e6db3b5c3744e65cbab4bfb62d Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 19 Jan 2011 12:10:36 +0100
Subject: [PATCH] lvmstrap: add more excluded FS types

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 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/lvmstrap b/tools/lvmstrap
index 7e8f85c52..1cc746d60 100755
--- a/tools/lvmstrap
+++ b/tools/lvmstrap
@@ -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
-- 
GitLab