Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurek committed Jun 5, 2014
2 parents f8baaf0 + f49fea5 commit 966f50b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
24 changes: 24 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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
~~~~~

Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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.
2 changes: 1 addition & 1 deletion src/ralph_pricing/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = (2, 3, 0)
VERSION = (2, 4, 0)
7 changes: 3 additions & 4 deletions src/ralph_pricing/plugins/collects/shares.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'])
Expand Down
1 change: 1 addition & 0 deletions src/ralph_pricing/plugins/collects/ventures.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def update_venture(data):
)
venture.parent = parent
else:
venture.parent = None
parent_created = False
venture.save()
return created + parent_created
Expand Down

0 comments on commit 966f50b

Please sign in to comment.