aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2019-03-18 09:55:51 +0000
committerBryn M. Reeves <bmr@redhat.com>2019-03-18 09:55:51 +0000
commitddc39b8e871ff0b26d7ba3fd8e13a5e64c7e39ca (patch)
tree7fedf09815afb2027fcf149c355ae7e36213d800
parent031ff485afd888a5ecf9297bde2c2659cf3e1ec5 (diff)
downloadsos-ddc39b8e871ff0b26d7ba3fd8e13a5e64c7e39ca.tar.gz
[azure] Added /var/log/azure directory to sosreport
Resolves: #1274 Suggested-by: Dave Mulford <dave.mulford@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/azure.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/sos/plugins/azure.py b/sos/plugins/azure.py
index 5198d1cf..e134457e 100644
--- a/sos/plugins/azure.py
+++ b/sos/plugins/azure.py
@@ -8,8 +8,8 @@
#
# See the LICENSE file in the source distribution for further information.
-from sos.plugins import Plugin, UbuntuPlugin, RedHatPlugin
import os
+from sos.plugins import Plugin, UbuntuPlugin, RedHatPlugin
class Azure(Plugin, UbuntuPlugin):
@@ -30,6 +30,15 @@ class Azure(Plugin, UbuntuPlugin):
"/sys/module/hv_storvsc/parameters/storvsc_ringbuffer_size"
])
+ # Adds all files under /var/log/azure to the sosreport
+ # os.walk is used because /var/log/azure is used by multiple Azure
+ # extensions and there is no standard log filename format
+ limit = self.get_option("log_size")
+
+ for path, subdirs, files in os.walk("/var/log/azure"):
+ for name in files:
+ self.add_copy_spec(os.path.join(path, name), sizelimit=limit)
+
self.add_cmd_output((
'curl -s -H Metadata:true '
'"http://169.254.169.254/metadata/instance?'