Skip to content

Commit

Permalink
Merge 06287d0 into 4f43b41
Browse files Browse the repository at this point in the history
  • Loading branch information
kula1922 committed May 30, 2014
2 parents 4f43b41 + 06287d0 commit edd0566
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/ralph/util/api_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ralph.discovery.models import (
Device,
DeviceType,
DiskShareMount,
DiskShare,
HistoryCost,
IPAddress,
)
Expand Down Expand Up @@ -126,20 +126,16 @@ def get_virtual_usages(parent_venture_name=None):
def get_shares():
"""Yields dicts reporting the storage shares for all servers."""

for mount in DiskShareMount.objects.select_related(
'share',
).filter(is_virtual=False):
for share in DiskShare.objects.all():
yield {
'storage_device_id': mount.share.device_id,
'mount_device_id': mount.device_id,
'device_id': share.device_id,
'model': (
mount.share.model.group.name
if mount.share.model.group
else mount.share.model.name
share.model.group.name
if share.model.group
else share.model.name
),
'label': mount.share.label,
'size': mount.get_size(),
'share_mount_count': mount.get_total_mounts(),
'label': share.label,
'size': share.size,
}


Expand Down

0 comments on commit edd0566

Please sign in to comment.