mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge branch '2019.2' into backport_51135
This commit is contained in:
commit
ac790a6e36
@ -5,4 +5,4 @@ pytest-salt == 2018.12.8
|
||||
pytest-timeout >= 1.3.3
|
||||
pytest-tempdir >= 2018.8.11
|
||||
pytest-helpers-namespace >= 2017.11.11
|
||||
pytest-salt-from-filenames >= 2019.1.22
|
||||
pytest-salt-runtests-bridge >= 2019.1.30
|
||||
|
@ -1620,7 +1620,7 @@ def set_authentication_profile(profile=None, deploy=False):
|
||||
'''
|
||||
|
||||
if not profile:
|
||||
CommandExecutionError("Profile name option must not be none.")
|
||||
raise CommandExecutionError("Profile name option must not be none.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1657,7 +1657,7 @@ def set_hostname(hostname=None, deploy=False):
|
||||
'''
|
||||
|
||||
if not hostname:
|
||||
CommandExecutionError("Hostname option must not be none.")
|
||||
raise CommandExecutionError("Hostname option must not be none.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1697,7 +1697,7 @@ def set_management_icmp(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1737,7 +1737,7 @@ def set_management_http(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1777,7 +1777,7 @@ def set_management_https(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1817,7 +1817,7 @@ def set_management_ocsp(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1857,7 +1857,7 @@ def set_management_snmp(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1897,7 +1897,7 @@ def set_management_ssh(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -1937,7 +1937,7 @@ def set_management_telnet(enabled=True, deploy=False):
|
||||
elif enabled is False:
|
||||
value = "yes"
|
||||
else:
|
||||
CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
raise CommandExecutionError("Invalid option provided for service enabled option.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -2130,7 +2130,7 @@ def set_permitted_ip(address=None, deploy=False):
|
||||
'''
|
||||
|
||||
if not address:
|
||||
CommandExecutionError("Address option must not be empty.")
|
||||
raise CommandExecutionError("Address option must not be empty.")
|
||||
|
||||
ret = {}
|
||||
|
||||
@ -2166,7 +2166,7 @@ def set_timezone(tz=None, deploy=False):
|
||||
'''
|
||||
|
||||
if not tz:
|
||||
CommandExecutionError("Timezone name option must not be none.")
|
||||
raise CommandExecutionError("Timezone name option must not be none.")
|
||||
|
||||
ret = {}
|
||||
|
||||
|
@ -19,6 +19,7 @@ from __future__ import absolute_import, unicode_literals, print_function
|
||||
|
||||
# Import python libs
|
||||
import os
|
||||
import re
|
||||
import stat
|
||||
import string
|
||||
import logging
|
||||
@ -91,15 +92,15 @@ def _validate_partition_boundary(boundary):
|
||||
'''
|
||||
Ensure valid partition boundaries are supplied.
|
||||
'''
|
||||
try:
|
||||
for unit in VALID_UNITS:
|
||||
if six.text_type(boundary).endswith(unit):
|
||||
return
|
||||
int(boundary)
|
||||
except Exception:
|
||||
raise CommandExecutionError(
|
||||
'Invalid partition boundary passed: "{0}"'.format(boundary)
|
||||
)
|
||||
boundary = six.text_type(boundary)
|
||||
match = re.search(r'^([\d.]+)(\D*)$', boundary)
|
||||
if match:
|
||||
unit = match.group(2)
|
||||
if not unit or unit in VALID_UNITS:
|
||||
return
|
||||
raise CommandExecutionError(
|
||||
'Invalid partition boundary passed: "{0}"'.format(boundary)
|
||||
)
|
||||
|
||||
|
||||
def probe(*devices):
|
||||
|
@ -739,7 +739,7 @@ def set_lcm_config(config_mode=None,
|
||||
cmd += ' RefreshFrequencyMins = {0};'.format(refresh_freq)
|
||||
if reboot_if_needed is not None:
|
||||
if not isinstance(reboot_if_needed, bool):
|
||||
SaltInvocationError('reboot_if_needed must be a boolean value')
|
||||
raise SaltInvocationError('reboot_if_needed must be a boolean value')
|
||||
if reboot_if_needed:
|
||||
reboot_if_needed = '$true'
|
||||
else:
|
||||
|
@ -163,7 +163,7 @@ def formatted(name, fs_type='ext4', force=False, **kwargs):
|
||||
|
||||
# Repeat fstype check up to 10 times with 3s sleeping between each
|
||||
# to avoid detection failing although mkfs has succeeded
|
||||
# see https://github.com/saltstack/salt/issues/25775i
|
||||
# see https://github.com/saltstack/salt/issues/25775
|
||||
# This retry maybe superfluous - switching to blkid
|
||||
for i in range(10):
|
||||
|
||||
|
3
tox.ini
3
tox.ini
@ -30,11 +30,8 @@ commands = pytest --rootdir {toxinidir} --log-file={toxinidir}/artifacts/logs/ru
|
||||
|
||||
[testenv:runtests-coverage]
|
||||
# Add tests/support/coverage to PYTHONPATH in order to get code coverage from subprocesses.
|
||||
# Additional, set the COVERAGE_PROCESS_START environment variable so that the coverage library
|
||||
# knows it's supposed to track subprocesses.
|
||||
setenv =
|
||||
PYTHONPATH={toxinidir}/tests/support/coverage
|
||||
COVERAGE_PROCESS_START={toxinidir}/.coveragerc
|
||||
commands_pre =
|
||||
- coverage erase
|
||||
commands =
|
||||
|
Loading…
Reference in New Issue
Block a user