mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
f2f7e9f537
Gracefully exit the minion while informing the user of the cause of the error if the IP address of the master is malformed such that it can not even be dealt with by Python's socket module. Unit testing for the above condition. Closes #9440. Remove suprious debugging statement. Remove more spurious debugging.
23 lines
616 B
Python
23 lines
616 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
:codauthor: :email:`Mike Place <mp@saltstack.com>`
|
|
'''
|
|
|
|
# Import Salt Testing libs
|
|
from salttesting import TestCase
|
|
from salttesting.helpers import ensure_in_syspath
|
|
from salttesting.mock import patch
|
|
|
|
from salt import minion
|
|
from salt.exceptions import SaltSystemExit
|
|
|
|
|
|
ensure_in_syspath('../')
|
|
|
|
__opts__ = {}
|
|
|
|
|
|
class MinionTestCase(TestCase):
|
|
def test_invalid_master_address(self):
|
|
with patch.dict(__opts__, {'ipv6': False, 'master': float('127.0'), 'master_port': '4555', 'retry_dns': False}):
|
|
self.assertRaises(SaltSystemExit, minion.resolve_dns, __opts__) |