1. VectorLinux Core
  2. vinstall

Commits

Rodrigo Bistolfi  committed 8013dde

utils.py: improve format partition and fix xfs

  • Participants
  • Parent commits 0e49fdc
  • Branches master

Comments (0)

Files changed (1)

File vinstall/backend/utils.py

View file
  • Ignore whitespace
     """Create a filesystem in a partition using mkfs.
 
     """
-    if 'swap' in filesystem:
-        command = 'mkswap %s'% path
-    elif 'reiser' in filesystem:
-        command = 'mkfs.%s -f -f %s' % (filesystem, path)
-    else:
-        command = 'mkfs.%s -F %s' % (filesystem, path)
+    commands = {
+        "swap": "mkswap %s",
+        "reiserfs": "mkfs.reiserfs -f -f %s",
+        "xfs": "mkfs.xfs -f %s",
+        "jfs": "mkfs.jfs -f %s",
+        "ext2": "mkfs.ext2 -F %s",
+        "ext3": "mkfs.ext3 -F %s",
+        "ext4": "mkfs.ext4 -F %s"
+    }
+    command = commands[filesystem] % path
     sp.call(command.split())