-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsalt.patch
More file actions
122 lines (118 loc) · 5.75 KB
/
salt.patch
File metadata and controls
122 lines (118 loc) · 5.75 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
diff --git a/salt/utils/versions.py b/salt/utils/versions.py
index d5074e0..dff526a 100644
--- a/salt/utils/versions.py
+++ b/salt/utils/versions.py
@@ -171,7 +171,7 @@ def warn_until(
if _version_ >= version:
caller = inspect.getframeinfo(sys._getframe(stacklevel - 1))
- deprecated_message = (
+ raise RuntimeError(
"The warning triggered on filename '{filename}', line number "
"{lineno}, is supposed to be shown until version "
"{until_version} is released. Current version is now "
@@ -180,15 +180,8 @@ def warn_until(
lineno=caller.lineno,
until_version=version.formatted_version,
salt_version=_version_.formatted_version,
- )
+ ),
)
- if os.environ.get("RAISE_DEPRECATIONS_RUNTIME_ERRORS", "0") == "1":
- # We don't raise RuntimeError by default since that can break
- # users systems. We do however want to raise them in a CI context.
- raise RuntimeError(deprecated_message)
- # Otherwise, print the deprecated message to STDERR
- sys.stderr.write(f"\n{deprecated_message}\n")
- sys.stderr.flush()
if _dont_call_warnings is False and os.environ.get("PYTHONWARNINGS") != "ignore":
warnings.warn(
@@ -246,7 +239,7 @@ def warn_until_date(
today = _current_date or datetime.datetime.utcnow().date()
if today >= date:
caller = inspect.getframeinfo(sys._getframe(stacklevel - 1))
- deprecated_message = (
+ raise RuntimeError(
"{message} This warning(now exception) triggered on "
"filename '{filename}', line number {lineno}, is "
"supposed to be shown until {date}. Today is {today}. "
@@ -258,13 +251,6 @@ def warn_until_date(
today=today.isoformat(),
),
)
- if os.environ.get("RAISE_DEPRECATIONS_RUNTIME_ERRORS", "0") == "1":
- # We don't raise RuntimeError by default since that can break
- # users systems. We do however want to raise them in a CI context.
- raise RuntimeError(deprecated_message)
- # Otherwise, print the deprecated message to STDERR
- sys.stderr.write(f"\n{deprecated_message}\n")
- sys.stderr.flush()
if _dont_call_warnings is False and os.environ.get("PYTHONWARNINGS") != "ignore":
warnings.warn(
diff --git a/tests/pytests/functional/modules/state/test_jinja_filters.py b/tests/pytests/functional/modules/state/test_jinja_filters.py
index 0acad0a..c6683d0 100644
--- a/tests/pytests/functional/modules/state/test_jinja_filters.py
+++ b/tests/pytests/functional/modules/state/test_jinja_filters.py
@@ -385,7 +385,7 @@ def _filter_id(value):
sls=r"""
{% if grains['os'] == 'Windows' %}
{% set result = 'c:\Windows\System32\cmd.exe' | is_bin_file() %}
- {% elif grains['os_family'] == 'Debian' %}
+ {% elif grains['os_family'] in ['Debian', 'RedHat', 'Suse'] %}
{% set result = '/usr/bin/file' | is_bin_file() %}
{% else %}
{% set result = '/bin/file' | is_bin_file() %}
diff --git a/tests/pytests/functional/modules/test_x509_v2.py b/tests/pytests/functional/modules/test_x509_v2.py
index c8d1546..da37f88 100644
--- a/tests/pytests/functional/modules/test_x509_v2.py
+++ b/tests/pytests/functional/modules/test_x509_v2.py
@@ -447,7 +447,7 @@ def cert_exts_read():
"sha256": "E4:EB:84:87:17:80:E4:6D:6E:B8:9C:A0:EE:88:AF:CA:57:C7:8A:86:5A:A8:53:E1:38:DF:7A:43:D7:19:54:E1",
},
"issuer": OrderedDict([("C", "US"), ("O", "Salt"), ("CN", "Test")]),
- "issuer_hash": "19:2C:28:89",
+ "issuer_hash": "89:28:2C:19",
"issuer_str": "O=Salt,CN=Test,C=US",
"key_size": 2048,
"key_type": "rsa",
@@ -465,7 +465,7 @@ def cert_exts_read():
"serial_number": "0C:F5:41:98:4E:97:67:47:B5:E6:1C:22:D6:54:2B:56:B3:B4:FD:6F",
"signature_algorithm": "sha256WithRSAEncryption",
"subject": OrderedDict(),
- "subject_hash": "D6:DC:44:F9",
+ "subject_hash": "F9:44:DC:D6",
"subject_str": "",
"version": 3,
}
@@ -532,7 +532,7 @@ def csr_exts_read():
"key_type": "rsa",
"public_key_hash": "90:B6:4E:36:84:1F:EA:9F:13:DA:D2:E6:32:E5:89:1B:78:92:99:E4",
"subject": OrderedDict(),
- "subject_hash": "D6:DC:44:F9",
+ "subject_hash": "F9:44:DC:D6",
"subject_str": "",
}
diff --git a/tests/pytests/integration/minion/test_schedule_large_event.py b/tests/pytests/integration/minion/test_schedule_large_event.py
index bbc4461..bbbe104 100644
--- a/tests/pytests/integration/minion/test_schedule_large_event.py
+++ b/tests/pytests/integration/minion/test_schedule_large_event.py
@@ -99,7 +99,7 @@ def test_schedule_large_event(salt_master_1, salt_minion_1, script):
salt_master_1.config["sock_dir"],
salt_master_1.config,
) as event:
- event = event.get_event(tag="bigevent", wait=15)
+ event = event.get_event(tag="bigevent", wait=60)
assert event
assert "data" in event
assert len(event["data"]) == 10000
diff --git a/tests/unit/modules/test_saltcheck.py b/tests/unit/modules/test_saltcheck.py
index 059e282..1f5888b 100644
--- a/tests/unit/modules/test_saltcheck.py
+++ b/tests/unit/modules/test_saltcheck.py
@@ -25,6 +25,7 @@ class SaltcheckTestCase(TestCase, LoaderModuleMockMixin):
local_opts = salt.config.minion_config(
os.path.join(syspaths.CONFIG_DIR, "minion")
)
+ local_opts["cachedir"] = "/tmp/salt-cache"
local_opts["file_client"] = "local"
local_opts["conf_file"] = "/etc/salt/minion"
tmp = tempfile.mkdtemp(prefix="saltcheck-unit-")