summaryrefslogtreecommitdiff
blob: 9e58d93f7dd45307d6128d962208636a4ffb3806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 18fb0be96a146589ccbd642caa9244480c51140b Mon Sep 17 00:00:00 2001
From: Matthew Summers <msummers42@gmail.com>
Date: Mon, 9 Oct 2017 20:38:52 -0500
Subject: [PATCH 1/2] addresses issue #43307, disk.format_ to disk.format

This change fixes breakage. It appears the disk.format_ func is
aliased to disk.format in modules/disk.py
---
 salt/states/blockdev.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/salt/states/blockdev.py b/salt/states/blockdev.py
index 4b0dc5ca81d..e6ecfeab3f1 100644
--- a/salt/states/blockdev.py
+++ b/salt/states/blockdev.py
@@ -159,7 +159,7 @@ def formatted(name, fs_type='ext4', force=False, **kwargs):
         ret['result'] = None
         return ret
 
-    __salt__['disk.format_'](name, fs_type, force=force, **kwargs)
+    __salt__['disk.format'](name, fs_type, force=force, **kwargs)
 
     # Repeat fstype check up to 10 times with 3s sleeping between each
     # to avoid detection failing although mkfs has succeeded

From 16e1c1dfc86920b7a00dbf7c39b805c359e4d13b Mon Sep 17 00:00:00 2001
From: Matthew Summers <matthew.summers@syapse.com>
Date: Mon, 16 Oct 2017 09:47:40 -0500
Subject: [PATCH 2/2] fixed test addressing issue #43307, disk.format_ to
 disk.format

---
 tests/unit/states/test_blockdev.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/unit/states/test_blockdev.py b/tests/unit/states/test_blockdev.py
index e5899f1c70a..9b559dddfe5 100644
--- a/tests/unit/states/test_blockdev.py
+++ b/tests/unit/states/test_blockdev.py
@@ -100,7 +100,7 @@ def test_formatted(self):
 
             # Test state return when block device format fails
             with patch.dict(blockdev.__salt__, {'cmd.run': MagicMock(return_value=mock_ext4),
-                                                'disk.format_': MagicMock(return_value=True)}):
+                                                'disk.format': MagicMock(return_value=True)}):
                 comt = ('Failed to format {0}'.format(name))
                 ret.update({'comment': comt, 'result': False})
                 with patch.object(salt.utils, 'which',