Module: check_mk
Branch: master
Commit: 43c4262e95ef3f90bde43f0ca35c772c496620c9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=43c4262e95ef3f…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Feb 12 14:58:09 2019 +0100
agent_aws: Do not store cache data if '--no-cache' option is used
Change-Id: I5ed4deaa37c53f632e442ec3cda78ed46ae229f0
---
agents/special/agent_aws | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/agents/special/agent_aws b/agents/special/agent_aws
index 7da76ee..9c9053b 100755
--- a/agents/special/agent_aws
+++ b/agents/special/agent_aws
@@ -217,7 +217,8 @@ class AWSSection(object):
else:
raw_content = self._fetch_raw_content(colleague_contents)
# TODO: Write cache only when _compute_section_content succeeded?
- self._write_to_cache(raw_content)
+ if use_cache:
+ self._write_to_cache(raw_content)
cache_timestamp = time.time()
return AWSRawContent(raw_content, cache_timestamp)
@@ -1355,7 +1356,10 @@ def parse_arguments(argv):
action="store_true",
help="Log messages from AWS library 'boto3' and
'botocore'.")
parser.add_argument(
- "--no-cache", action="store_true", help="Execute all
sections, do not rely on cached data.")
+ "--no-cache",
+ action="store_true",
+ help="Execute all sections, do not rely on cached data. Cached data will not
be overwritten."
+ )
parser.add_argument(
"--access-key-id", required=True, help="The access key for your
AWS account.")