diff --git a/CHANGES.rst b/CHANGES.rst index a263db50..72bfaab7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,30 @@ Change Log ---------- +2.4.0 +~~~~~ + +* New devices report + +* Devices ventures changes report + +* New ceilometer report plugin logic and logging tweakups + +* Fixed asset collect plugin (replacing to None) + +* Ceilometer collect plugin bugfixes + +* Added venture tree rebuild when venture plugin job is finished + +* Fixed extra costs - add more than 5 rows (with dynamic adding) + +* Fixed header in csv statement + +* Improved gitignore and manifest + +* When venture have no parent set venture parent as none + + 2.3.0 ~~~~~ diff --git a/README.rst b/README.rst index 738340b5..3433bbe7 100644 --- a/README.rst +++ b/README.rst @@ -2,13 +2,13 @@ Pricing module for Ralph ===== -.. image:: https://pypip.in/v/ralph_pricing/badge.png - :target: https://crate.io/packages/ralph_pricing/ +.. image:: https://pypip.in/v/scrooge/badge.png + :target: https://crate.io/packages/scrooge/ :alt: Latest PyPI version -.. image:: https://pypip.in/d/ralph_pricing/badge.svg - :target: https://crate.io/packages/ralph_pricing/ +.. image:: https://pypip.in/d/scrooge/badge.svg + :target: https://crate.io/packages/scrooge/ :alt: Number of PyPI downloads @@ -20,8 +20,8 @@ Pricing module for Ralph :target: https://coveralls.io/r/allegro/ralph_pricing?branch=develop -.. image:: https://pypip.in/license/ralph_pricing/badge.svg - :target: https://crate.io/packages/ralph_pricing/ +.. image:: https://pypip.in/license/scrooge/badge.svg + :target: https://crate.io/packages/scrooge/ The pricing module aggregates data from Ralph and from Ralph Assets to generate reports showing the prices of the servers in inventory per their owners daily. diff --git a/src/ralph_pricing/__init__.py b/src/ralph_pricing/__init__.py index af316806..7d11e273 100644 --- a/src/ralph_pricing/__init__.py +++ b/src/ralph_pricing/__init__.py @@ -1 +1 @@ -VERSION = (2, 3, 0) +VERSION = (2, 4, 0) diff --git a/src/ralph_pricing/plugins/collects/shares.py b/src/ralph_pricing/plugins/collects/shares.py index ce0f4d85..4aed26f0 100644 --- a/src/ralph_pricing/plugins/collects/shares.py +++ b/src/ralph_pricing/plugins/collects/shares.py @@ -28,9 +28,9 @@ def update_usage(device, venture, usage_name, date, value): def update(data, date): - if data.get('mount_device_id') is not None: + if data.get('device_id') is not None: device, created = Device.objects.get_or_create( - device_id=data['mount_device_id'], + device_id=data['device_id'], ) else: return @@ -39,9 +39,8 @@ def update(data, date): venture = daily_device.pricing_venture except DailyDevice.DoesNotExist: venture = None - size = data['size'] / data['share_mount_count'] usage_name = 'Disk Share {0} MB'.format(data['model']) - update_usage(device, venture, usage_name, date, size) + update_usage(device, venture, usage_name, date, data['size']) @plugin.register(chain='pricing', requires=['assets']) diff --git a/src/ralph_pricing/plugins/collects/ventures.py b/src/ralph_pricing/plugins/collects/ventures.py index 4f56e263..0c01cd34 100644 --- a/src/ralph_pricing/plugins/collects/ventures.py +++ b/src/ralph_pricing/plugins/collects/ventures.py @@ -25,6 +25,7 @@ def update_venture(data): ) venture.parent = parent else: + venture.parent = None parent_created = False venture.save() return created + parent_created