monk-ee / SplunkAppforAWSBilling

8 stars 3 forks source link

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

Closed monk-ee closed 8 years ago

monk-ee commented 8 years ago

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

monk-ee commented 8 years ago

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'

monk-ee commented 8 years ago

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))