Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #7 from meckstmd/fix-issue-003-rhel-ris
Browse files Browse the repository at this point in the history
Added mapping so RHEL reserved instances work.
  • Loading branch information
meckstmd committed Aug 19, 2019
2 parents 8328068 + 8177dba commit df19fde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ariel/__init__.py
Expand Up @@ -2,7 +2,7 @@
# Licensed under the terms of the Apache License, Version 2.0. See LICENSE file for terms.
__all__ = ['generate_reports', 'get_account_instance_summary', 'get_account_names', 'get_ec2_pricing', 'get_locations',
'get_reserved_instances', 'get_unlimited_summary', 'get_unused_box_summary', 'utils', 'LOGGER']
__version__='2.0.3'
__version__='2.0.4'

import logging
LOG_LEVEL = logging.INFO
Expand Down
13 changes: 12 additions & 1 deletion ariel/get_reserved_instances.py
Expand Up @@ -49,7 +49,18 @@ def load(config):
# Make sure to only capture active RIs
endDate = datetime.datetime.strptime(row['Attributes']['endDateTime'], "%Y-%m-%dT%H:%M:%S.000Z")
if endDate.date() > datetime.date.today():
operatingSystem = 'Linux' if row['Attributes']['platform'] == 'Linux/UNIX' else row['Attributes']['platform'] # for CUR compatibility

# these mappings are needed for CUR compatibility
# the current pricing report uses the following operating systems:
# Linux, RHEL, SUSE, Windows
platform = row['Attributes']['platform']
if platform == 'Linux/UNIX':
operatingSystem = 'Linux'
elif platform == 'Red Hat Enterprise Linux':
operatingSystem = 'RHEL'
else:
operatingSystem = platform

ri = {
'accountid': int(row['Attributes']['accountId']),
'accountname': row['Attributes']['accountName'],
Expand Down

0 comments on commit df19fde

Please sign in to comment.