monk-ee / SplunkAppforAWSBilling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If migrating from < 2.0.9 the aws.yaml file is missing the history stanza

monk-ee opened this issue · comments

The history stanza is missing from the aws.yaml file, this causes upgrades to fail.
history: 12

m```
onkees-MacBook-Pro:bin root# /Applications/Splunk/bin/splunk cmd python FetchDetailedReport.py
Traceback (most recent call last):
File "FetchDetailedReport.py", line 181, in
fdr = FetchDetailedReport()
File "FetchDetailedReport.py", line 48, in init
self.process_files()
File "FetchDetailedReport.py", line 99, in process_files
for month in range(-int(self.config['history']), 0):
KeyError: 'history'

I am going to preset this value in case it is missing - catch it, then log a recoverable error. something like this:

history = 12 try: history = int(self.config['history']) except KeyError, kerr: self.logger.error("Failed to find history stanza from the configuration file aws.yaml. This is a known" "upgrade problem, see README for fix. Fudging value to 12 months for now," "Error Details: " + str(kerr))