51d9b78cf8
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=156
58 lines
2.4 KiB
Diff
58 lines
2.4 KiB
Diff
From 10df6dcff22785962dc372064c899b942f3c1ff9 Mon Sep 17 00:00:00 2001
|
|
From: Mihai Dinca <mdinca@suse.de>
|
|
Date: Fri, 14 Jun 2019 15:13:12 +0200
|
|
Subject: [PATCH] Move server_id deprecation warning to reduce log
|
|
spamming (bsc#1135567) (bsc#1135732)
|
|
|
|
---
|
|
salt/grains/core.py | 4 ----
|
|
salt/minion.py | 9 +++++++++
|
|
2 files changed, 9 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/salt/grains/core.py b/salt/grains/core.py
|
|
index ab37a4dd44..30eba0ce99 100644
|
|
--- a/salt/grains/core.py
|
|
+++ b/salt/grains/core.py
|
|
@@ -2867,10 +2867,6 @@ def get_server_id():
|
|
if bool(use_crc):
|
|
id_hash = getattr(zlib, use_crc, zlib.adler32)(__opts__.get('id', '').encode()) & 0xffffffff
|
|
else:
|
|
- salt.utils.versions.warn_until('Sodium', 'This server_id is computed nor by Adler32 neither by CRC32. '
|
|
- 'Please use "server_id_use_crc" option and define algorithm you'
|
|
- 'prefer (default "Adler32"). The server_id will be computed with'
|
|
- 'Adler32 by default.')
|
|
id_hash = _get_hash_by_shell()
|
|
server_id = {'server_id': id_hash}
|
|
|
|
diff --git a/salt/minion.py b/salt/minion.py
|
|
index c5f637eaa6..2c0a18604e 100644
|
|
--- a/salt/minion.py
|
|
+++ b/salt/minion.py
|
|
@@ -102,6 +102,7 @@ from salt.utils.odict import OrderedDict
|
|
from salt.utils.process import (default_signals,
|
|
SignalHandlingMultiprocessingProcess,
|
|
ProcessManager)
|
|
+from salt.utils.versions import warn_until
|
|
from salt.exceptions import (
|
|
CommandExecutionError,
|
|
CommandNotFoundError,
|
|
@@ -993,6 +994,14 @@ class MinionManager(MinionBase):
|
|
if (self.opts['master_type'] in ('failover', 'distributed')) or not isinstance(self.opts['master'], list):
|
|
masters = [masters]
|
|
|
|
+ if not self.opts.get('server_id_use_crc'):
|
|
+ warn_until(
|
|
+ 'Sodium',
|
|
+ 'This server_id is computed nor by Adler32 neither by CRC32. '
|
|
+ 'Please use "server_id_use_crc" option and define algorithm you'
|
|
+ 'prefer (default "Adler32"). The server_id will be computed with'
|
|
+ 'Adler32 by default.')
|
|
+
|
|
beacons_leader = True
|
|
for master in masters:
|
|
s_opts = copy.deepcopy(self.opts)
|
|
--
|
|
2.16.4
|
|
|
|
|