Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 634464
Collapse All | Expand All

(-)a/salt/states/blockdev.py (-2 / +1 lines)
Lines 159-165 def formatted(name, fs_type='ext4', force=False, **kwargs): Link Here
159
        ret['result'] = None
159
        ret['result'] = None
160
        return ret
160
        return ret
161
161
162
    __salt__['disk.format_'](name, fs_type, force=force, **kwargs)
162
    __salt__['disk.format'](name, fs_type, force=force, **kwargs)
163
163
164
    # Repeat fstype check up to 10 times with 3s sleeping between each
164
    # Repeat fstype check up to 10 times with 3s sleeping between each
165
    # to avoid detection failing although mkfs has succeeded
165
    # to avoid detection failing although mkfs has succeeded
166
disk.format
166
disk.format
167
--
168
tests/unit/states/test_blockdev.py | 2 +-
167
tests/unit/states/test_blockdev.py | 2 +-
169
1 file changed, 1 insertion(+), 1 deletion(-)
168
1 file changed, 1 insertion(+), 1 deletion(-)
(-)a/tests/unit/states/test_blockdev.py (-1 / +1 lines)
Lines 100-106 def test_formatted(self): Link Here
100
100
101
            # Test state return when block device format fails
101
            # Test state return when block device format fails
102
            with patch.dict(blockdev.__salt__, {'cmd.run': MagicMock(return_value=mock_ext4),
102
            with patch.dict(blockdev.__salt__, {'cmd.run': MagicMock(return_value=mock_ext4),
103
                                                'disk.format_': MagicMock(return_value=True)}):
103
                                                'disk.format': MagicMock(return_value=True)}):
104
                comt = ('Failed to format {0}'.format(name))
104
                comt = ('Failed to format {0}'.format(name))
105
                ret.update({'comment': comt, 'result': False})
105
                ret.update({'comment': comt, 'result': False})
106
                with patch.object(salt.utils, 'which',
106
                with patch.object(salt.utils, 'which',

Return to bug 634464