2020-04-07 14:14:01 +02:00
|
|
|
From c375d1e25e8b5c77b6a8f89855f17df6e49db9f2 Mon Sep 17 00:00:00 2001
|
2019-09-06 14:06:25 +02:00
|
|
|
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
|
2020-04-07 14:14:01 +02:00
|
|
|
index b58c29dbc3..0f3ccd9b92 100644
|
2019-09-06 14:06:25 +02:00
|
|
|
--- a/salt/grains/core.py
|
|
|
|
+++ b/salt/grains/core.py
|
2020-04-07 14:14:01 +02:00
|
|
|
@@ -2890,10 +2890,6 @@ def get_server_id():
|
2019-09-06 14:06:25 +02:00
|
|
|
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
|
2020-04-07 14:14:01 +02:00
|
|
|
index 457f485b0a..4730f68b87 100644
|
2019-09-06 14:06:25 +02:00
|
|
|
--- a/salt/minion.py
|
|
|
|
+++ b/salt/minion.py
|
2020-04-07 14:14:01 +02:00
|
|
|
@@ -97,6 +97,7 @@ from salt.utils.odict import OrderedDict
|
2019-09-06 14:06:25 +02:00
|
|
|
from salt.utils.process import (default_signals,
|
2020-04-07 14:14:01 +02:00
|
|
|
SignalHandlingProcess,
|
2019-09-06 14:06:25 +02:00
|
|
|
ProcessManager)
|
|
|
|
+from salt.utils.versions import warn_until
|
|
|
|
from salt.exceptions import (
|
|
|
|
CommandExecutionError,
|
|
|
|
CommandNotFoundError,
|
2020-04-07 14:14:01 +02:00
|
|
|
@@ -1002,6 +1003,14 @@ class MinionManager(MinionBase):
|
2019-09-06 14:06:25 +02:00
|
|
|
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.')
|
|
|
|
+
|
2019-11-28 16:41:55 +01:00
|
|
|
beacons_leader = True
|
2019-09-06 14:06:25 +02:00
|
|
|
for master in masters:
|
|
|
|
s_opts = copy.deepcopy(self.opts)
|
|
|
|
--
|
2019-11-28 16:41:55 +01:00
|
|
|
2.16.4
|
2019-09-06 14:06:25 +02:00
|
|
|
|
|
|
|
|