Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Commit

Permalink
change data method
Browse files Browse the repository at this point in the history
  • Loading branch information
sdayu committed Jun 6, 2016
1 parent 8508d06 commit d0bd8d9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nokkhumapi/views/admin/compute_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ def get_resources(self):
compute_node = models.ComputeNode.objects().with_id(compute_node_id)

ctz = tz.tzlocal()

resources = [
dict(
cpu=r.cpu._data,
memory=r.memory._data,
disk=r.disk._data,
cpu=dict(r.cpu.to_mongo()),
memory=dict(r.memory.to_mongo()),
disk=dict(r.disk.to_mongo()),
reported_date=r.reported_date.replace(tzinfo=ctz)
) for r in compute_node.resource_records
]

#print(resources)
return dict(
resources=resources
)
Expand Down

0 comments on commit d0bd8d9

Please sign in to comment.