Skip to content

Commit

Permalink
#1 fix to work for a single account, no org
Browse files Browse the repository at this point in the history
  • Loading branch information
jimzucker committed Dec 20, 2020
1 parent 4fdc8a5 commit 4e54f18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions get_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def calc_forecast(boto3_session):
"forecast_variance": variance
}
output.append(result)

return output


Expand All @@ -316,7 +317,7 @@ def format_rows(output,account_width):
lines = sorted(output, key=lambda k: k.get('amount_forecast'), reverse=True)
for line in lines :
if len(lines) == 2 and line.get('account_name') == 'Total':
break
continue
change = "{0:,.1f}%".format(line.get('forecast_variance'))
row = {
"Account": line.get('account_name')[:account_width].ljust(account_width),
Expand All @@ -325,7 +326,7 @@ def format_rows(output,account_width):
"Change": change.rjust(change_width)
}
output_rows.append(row)

return output_rows

def publish_forecast(boto3_session) :
Expand Down

0 comments on commit 4e54f18

Please sign in to comment.