diff --git a/tuskar_ui/infrastructure/nodes/tabs.py b/tuskar_ui/infrastructure/nodes/tabs.py index e7eead1f3..40b2b1117 100644 --- a/tuskar_ui/infrastructure/nodes/tabs.py +++ b/tuskar_ui/infrastructure/nodes/tabs.py @@ -59,6 +59,8 @@ class OverviewTab(tabs.Tab): 'nodes_down_count': utils.length(nodes_down), 'nodes_provisioned_count': utils.length(nodes_provisioned), 'nodes_free_count': utils.length(nodes_free), + 'nodes_all_count': (utils.length(nodes_provisioned) + + utils.length(nodes_free)) } if api_base.is_service_enabled(self.request, 'metering'): diff --git a/tuskar_ui/infrastructure/nodes/templates/nodes/_overview.html b/tuskar_ui/infrastructure/nodes/templates/nodes/_overview.html index d41c9ca14..d88e08684 100644 --- a/tuskar_ui/infrastructure/nodes/templates/nodes/_overview.html +++ b/tuskar_ui/infrastructure/nodes/templates/nodes/_overview.html @@ -6,144 +6,37 @@
{% trans 'Metering service is not enabled.' %}
- {% endif %}{% trans 'Metering service is not enabled.' %}
+{% endif %} diff --git a/tuskar_ui/utils/metering.py b/tuskar_ui/utils/metering.py index 981c93327..e286cff2c 100644 --- a/tuskar_ui/utils/metering.py +++ b/tuskar_ui/utils/metering.py @@ -20,6 +20,7 @@ from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from openstack_dashboard.api import ceilometer +import pytz SETTINGS = { 'settings': { @@ -140,8 +141,8 @@ def _calc_date_args(date_from, date_to, date_options): if date_options == "other": try: if date_from: - date_from = datetime.strptime(date_from, - "%Y-%m-%d") + date_from = pytz.utc.localize( + datetime.strptime(date_from, "%Y-%m-%d")) else: # TODO(lsmola) there should be probably the date # of the first sample as default, so it correctly @@ -149,8 +150,8 @@ def _calc_date_args(date_from, date_to, date_options): # and limit of samples to obtain that. pass if date_to: - date_to = datetime.strptime(date_to, - "%Y-%m-%d") + date_to = pytz.utc.localize( + datetime.strptime(date_to, "%Y-%m-%d")) # It return beginning of the day, I want the and of # the day, so i will add one day without a second. date_to = (date_to + timedelta(days=1) -