Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

plugin - sync data form assets #12

Merged
merged 6 commits into from May 9, 2013

Conversation

Projects
None yet
2 participants
Contributor

wmatyskiewicz commented May 7, 2013

wvsmh

@deshipu deshipu commented on an outdated diff May 7, 2013

src/ralph_pricing/plugins/assets.py
+# -*- coding: utf-8 -*-
+
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from ralph.util import plugin
+from ralph_assets.api_pricing import get_assets
+from ralph_pricing.models import Device
+
+
+def update_assets(data, date):
+ device, created = Device.objects.get(
+ device_id=data['device_id'],
+ )
@deshipu

deshipu May 7, 2013

Contributor

What happens when the device is missing?

@deshipu

deshipu May 7, 2013

Contributor

Device.objetcs.get returns the instance, not a tuple.

@deshipu deshipu commented on an outdated diff May 7, 2013

src/ralph_pricing/plugins/assets.py
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+from __future__ import unicode_literals
+
+from ralph.util import plugin
+from ralph_assets.api_pricing import get_assets
+from ralph_pricing.models import Device
+
+
+def update_assets(data, date):
+ device, created = Device.objects.get(
+ device_id=data['device_id'],
+ )
+ device.asset_id = data['asset_id']
+ device.slots = data['slots']
@deshipu

deshipu May 7, 2013

Contributor

What about deprecation?

@deshipu deshipu commented on the diff May 7, 2013

src/ralph_pricing/plugins/assets.py
+from ralph_assets.api_pricing import get_assets
+from ralph_pricing.models import Device
+
+
+def update_assets(data, date):
+ device, created = Device.objects.get(
+ device_id=data['device_id'],
+ )
+ device.asset_id = data['asset_id']
+ device.slots = data['slots']
+ device.save()
+ daily, daily_created = DailyDevice.objects.get_or_create(
+ date=date,
+ pricing_device=device,
+ )
+ daily.price
@deshipu

deshipu May 7, 2013

Contributor

This line does nothing.

Contributor

wmatyskiewicz commented May 9, 2013

blocker was merged

@deshipu deshipu added a commit that referenced this pull request May 9, 2013

@deshipu deshipu Merge pull request #12 from wmatyskiewicz/plugins
plugin - sync data form assets
cb7ce73

@deshipu deshipu merged commit cb7ce73 into allegro:master May 9, 2013

@kula1922 kula1922 added a commit that referenced this pull request Dec 16, 2014

@kula1922 kula1922 Merge pull request #12 from xliiv/feature/allocation-client-sla
Feature/allocation-client
2b98a9e

@xor-xor xor-xor added a commit to xor-xor/ralph_pricing that referenced this pull request Sep 19, 2016

@xor-xor xor-xor wip #12 093aded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment