SHA256
1
0
forked from pool/salt
salt/fix-decrease-loglevel-when-unable-to-resolve-addr.patch
Bo Maryniuk 7966fde1ef Accepting request 626472 from home:mdinca:branches:systemsmanagement:saltstack
- Update to 2018.3.2
  See https://docs.saltstack.com/en/latest/topics/releases/2018.3.2.html
  for full changelog
- Added:
  * accounting-for-when-files-in-an-archive-contain-non-.patch
  * add-all_versions-parameter-to-include-all-installed-.patch
  * add-custom-suse-capabilities-as-grains.patch
  * add-engine-relaying-libvirt-events.patch
  * add-environment-variable-to-know-if-yum-is-invoked-f.patch
  * add-other-attribute-to-gecos-fields-to-avoid-inconsi.patch
  * align-suse-salt-master.service-limitnofiles-limit-wi.patch
  * avoid-incomprehensive-message-if-crashes.patch
  * fix-deprecation-warning-bsc-1095507.patch
  * fix-diffing-binary-files-in-file.get_diff-bsc-109839.patch
  * fix-unboundlocalerror-in-file.get_diff.patch
  * fix-zypper.list_pkgs-to-be-aligned-with-pkg-state.patch
  * prevent-zypper-from-parsing-repo-configuration-from-.patch
  * remove-old-hack-when-reporting-multiversion-packages.patch
  * show-recommendations-for-salt-ssh-cross-version-pyth.patch
- Modified:
  * activate-all-beacons-sources-config-pillar-grains.patch
  * add-saltssh-multi-version-support-across-python-inte.patch
  * avoid-excessive-syslogging-by-watchdog-cronjob-58.patch
  * do-not-override-jid-on-returners-only-sending-back-t.patch
  * enable-passing-a-unix_socket-for-mysql-returners-bsc.patch
  * fall-back-to-pymysql.patch
  * feat-add-grain-for-all-fqdns.patch
  * fix-bsc-1065792.patch
  * fix-decrease-loglevel-when-unable-to-resolve-addr.patch
  * fix-for-ec2-rate-limit-failures.patch

OBS-URL: https://build.opensuse.org/request/show/626472
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=127
2018-07-30 11:52:13 +00:00

73 lines
2.5 KiB
Diff

From 5d12b612b1f7b05a13e7b8da02e50ec471a72187 Mon Sep 17 00:00:00 2001
From: Michele Bologna <michele.bologna@suse.com>
Date: Tue, 20 Mar 2018 19:27:36 +0100
Subject: [PATCH] Fix: decrease loglevel when unable to resolve addr
Upstream PR: https://github.com/saltstack/salt/pull/46575
It occurs that when the machine has multiple interfaces without an associated FQDN, Salt logs are polluted by this error.
Some examples:
```
caasp-admin:~ # uptime
09:08am up 0:13, 2 users, load average: 1.30, 1.37, 0.98
caasp-admin:~ # docker logs $(docker ps | grep salt-master | awk '{print $1}') 2>&1 | grep "Exception during resolving address" | wc -l
528
```
```
caasp-admin:~ # docker exec -it $(docker ps | grep salt-master | awk '{print $1}') salt '*' cmd.run uptime
b24f41eb4cc94624862ca0c9e8afcd15:
09:08am up 0:11, 0 users, load average: 1.26, 0.83, 0.40
admin:
09:08am up 0:13, 2 users, load average: 1.33, 1.37, 0.99
ba8c76af029043a39ba917f7ab2af796:
09:08am up 0:12, 0 users, load average: 0.84, 0.63, 0.32
7b7aa52158524556a0c46ae57569ce93:
09:08am up 0:11, 1 user, load average: 1.05, 0.77, 0.38
5ab0e18cbd084e9088a928a17edb86cb:
09:08am up 0:10, 0 users, load average: 0.12, 0.25, 0.20
1756c9cd9a9a402b91d8636400d1e512:
09:08am up 0:09, 0 users, load average: 0.12, 0.23, 0.14
ca:
09:08am up 0:13, 0 users, load average: 1.33, 1.37, 0.99
caasp-admin:~ # docker exec -it $(docker ps | grep salt-master | awk '{print $1}') salt '*' cmd.run "bash -c 'cat /var/log/salt/minion | grep \"Exception during resolving address\" | wc -l'"
admin:
63
ba8c76af029043a39ba917f7ab2af796:
47
5ab0e18cbd084e9088a928a17edb86cb:
55
7b7aa52158524556a0c46ae57569ce93:
59
b24f41eb4cc94624862ca0c9e8afcd15:
47
1756c9cd9a9a402b91d8636400d1e512:
59
ca:
25
```
This patch changes the log level of the exception to INFO, since the resolve-unable problem is not blocking.
---
salt/grains/core.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/salt/grains/core.py b/salt/grains/core.py
index 24de3cff6b..c166a43d7c 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -1907,7 +1907,7 @@ def fqdns():
fqdns.add(socket.gethostbyaddr(ip)[0])
except (socket.error, socket.herror,
socket.gaierror, socket.timeout) as e:
- log.error("Exception during resolving address: " + str(e))
+ log.info("Exception during resolving address: " + str(e))
grains['fqdns'] = list(fqdns)
return grains
--
2.13.7