Merge "Use iso time filter for time occurrences"

This commit is contained in:
Jenkins
2015-10-07 13:00:49 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 10 deletions

View File

@@ -261,12 +261,12 @@ def services_list(request, environment_id):
if service_id in reports and reports[service_id]: if service_id in reports and reports[service_id]:
last_operation = strip(reports[service_id].text) last_operation = strip(reports[service_id].text)
time = reports[service_id].updated.replace('T', ' ') time = reports[service_id].updated
else: else:
last_operation = 'Component draft created' \ last_operation = 'Component draft created' \
if environment.version == 0 else '' if environment.version == 0 else ''
try: try:
time = service_data['updated'].replace('T', ' ')[:-7] time = service_data['updated'][:-7]
except KeyError: except KeyError:
time = None time = None
@@ -336,11 +336,6 @@ def run_action(request, environment_id, action_id):
def deployments_list(request, environment_id): def deployments_list(request, environment_id):
LOG.debug('Deployments::List') LOG.debug('Deployments::List')
deployments = api.muranoclient(request).deployments.list(environment_id) deployments = api.muranoclient(request).deployments.list(environment_id)
for deployment in deployments:
if deployment.started:
deployment.started = deployment.started.replace('T', ' ')
if deployment.finished:
deployment.finished = deployment.finished.replace('T', ' ')
LOG.debug('Environment::List {0}'.format(deployments)) LOG.debug('Environment::List {0}'.format(deployments))
return deployments return deployments

View File

@@ -24,6 +24,7 @@ from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import messages from horizon import messages
from horizon import tables from horizon import tables
from horizon.utils import filters
from muranoclient.common import exceptions as exc from muranoclient.common import exceptions as exc
from oslo_log import log as logging from oslo_log import log as logging
@@ -355,7 +356,8 @@ class ServicesTable(tables.DataTable):
verbose_name=_('Last operation'), verbose_name=_('Last operation'),
filters=(defaultfilters.urlize, )) filters=(defaultfilters.urlize, ))
operation_updated = tables.Column('operation_updated', operation_updated = tables.Column('operation_updated',
verbose_name=_('Time updated')) verbose_name=_('Time updated'),
filters=(filters.parse_isotime,))
def get_object_id(self, datum): def get_object_id(self, datum):
return datum['?']['id'] return datum['?']['id']
@@ -445,9 +447,11 @@ class ShowDeploymentDetails(tables.LinkAction):
class DeploymentsTable(tables.DataTable): class DeploymentsTable(tables.DataTable):
started = tables.Column('started', started = tables.Column('started',
verbose_name=_('Time Started')) verbose_name=_('Time Started'),
filters=(filters.parse_isotime,))
finished = tables.Column('finished', finished = tables.Column('finished',
verbose_name=_('Time Finished')) verbose_name=_('Time Finished'),
filters=(filters.parse_isotime,))
status = tables.Column( status = tables.Column(
'state', 'state',