2021-01-08 13:41:50 +01:00
|
|
|
From be69780e4cb3047e8024fb87fdf2e15f049db154 Mon Sep 17 00:00:00 2001
|
2020-01-15 15:58:58 +01:00
|
|
|
From: Jochen Breuer <jbreuer@suse.de>
|
|
|
|
Date: Fri, 10 Jan 2020 17:18:14 +0100
|
|
|
|
Subject: [PATCH] Support for Btrfs and XFS in parted and mkfs
|
|
|
|
|
|
|
|
---
|
2021-01-08 13:41:50 +01:00
|
|
|
salt/modules/parted_partition.py | 8 ++------
|
|
|
|
tests/unit/modules/test_parted_partition.py | 5 -----
|
|
|
|
2 files changed, 2 insertions(+), 11 deletions(-)
|
2020-01-15 15:58:58 +01:00
|
|
|
|
|
|
|
diff --git a/salt/modules/parted_partition.py b/salt/modules/parted_partition.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index 9f321a822c..015d4cbc29 100644
|
2020-01-15 15:58:58 +01:00
|
|
|
--- a/salt/modules/parted_partition.py
|
|
|
|
+++ b/salt/modules/parted_partition.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -16,14 +16,11 @@ reference the man page for ``sfdisk(8)``.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import logging
|
|
|
|
-
|
|
|
|
-# Import python libs
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import stat
|
|
|
|
import string
|
|
|
|
|
|
|
|
-# Import Salt libs
|
|
|
|
import salt.utils.path
|
|
|
|
import salt.utils.platform
|
|
|
|
from salt.exceptions import CommandExecutionError
|
|
|
|
@@ -412,12 +409,11 @@ def _is_fstype(fs_type):
|
2020-01-15 15:58:58 +01:00
|
|
|
:param fs_type: file system type
|
|
|
|
:return: True if fs_type is supported in this module, False otherwise
|
2021-01-08 13:41:50 +01:00
|
|
|
"""
|
|
|
|
- return fs_type in (
|
|
|
|
+ return fs_type in {
|
|
|
|
"btrfs",
|
|
|
|
"ext2",
|
|
|
|
"ext3",
|
|
|
|
"ext4",
|
|
|
|
- "fat",
|
|
|
|
"fat32",
|
|
|
|
"fat16",
|
|
|
|
"linux-swap",
|
|
|
|
@@ -429,7 +425,7 @@ def _is_fstype(fs_type):
|
|
|
|
"ntfs",
|
|
|
|
"ufs",
|
|
|
|
"xfs",
|
|
|
|
- )
|
|
|
|
+ }
|
2020-01-15 15:58:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
def mkfs(device, fs_type):
|
|
|
|
diff --git a/tests/unit/modules/test_parted_partition.py b/tests/unit/modules/test_parted_partition.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index 3fff6acee8..073d29ba38 100644
|
2020-01-15 15:58:58 +01:00
|
|
|
--- a/tests/unit/modules/test_parted_partition.py
|
|
|
|
+++ b/tests/unit/modules/test_parted_partition.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -6,14 +6,9 @@
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
"""
|
|
|
|
|
|
|
|
-# Import Python libs
|
2020-01-15 15:58:58 +01:00
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
import salt.modules.parted_partition as parted
|
|
|
|
-
|
|
|
|
-# Import Salt libs
|
|
|
|
from salt.exceptions import CommandExecutionError
|
|
|
|
-
|
|
|
|
-# Import Salt Testing libs
|
|
|
|
from tests.support.mixins import LoaderModuleMockMixin
|
|
|
|
from tests.support.mock import MagicMock, patch
|
|
|
|
from tests.support.unit import TestCase
|
2020-01-15 15:58:58 +01:00
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2020-01-15 15:58:58 +01:00
|
|
|
|
|
|
|
|