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

Commit

Permalink
change local time zone
Browse files Browse the repository at this point in the history
  • Loading branch information
sdayu committed Aug 6, 2014
1 parent 67c9fb2 commit 3289fc0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nokkhumapi/views/admin/compute_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pyramid.response import Response
from pyramid.security import authenticated_userid

from dateutil import tz, parser
from nokkhumapi import models


Expand Down Expand Up @@ -101,12 +102,13 @@ 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,
reported_date=r.reported_date
reported_date=r.reported_date.replace(tzinfo=ctz)
) for r in compute_node.resource_records
]

Expand Down

0 comments on commit 3289fc0

Please sign in to comment.