Commit 3a2fbabb authored by chenghuiyu's avatar chenghuiyu Committed by Pierre Riteau

Stop using oslo_utils.timeutils.strtime()

This patch stops using oslo_utils.timeutils.strtime(), as it was
deprecated in version 1.6 and will be removed in a future version.

Change-Id: I6690420c8ce001ed12f47f78e657b4ad26bec816
parent 57e0e5bd
......@@ -53,8 +53,7 @@ class LeaseClientManager(base.BaseClientManager):
lease = self.get(lease_id)
if end_date:
date = timeutils.parse_strtime(end_date, utils.API_DATE_FORMAT)
values['end_date'] = timeutils.strtime(date,
utils.API_DATE_FORMAT)
values['end_date'] = date.strftime(utils.API_DATE_FORMAT)
else:
self._add_lease_date(values, lease, 'end_date',
lease_end_date_change,
......@@ -66,8 +65,7 @@ class LeaseClientManager(base.BaseClientManager):
if start_date:
date = timeutils.parse_strtime(start_date,
utils.API_DATE_FORMAT)
values['start_date'] = timeutils.strtime(date,
utils.API_DATE_FORMAT)
values['start_date'] = date.strftime(utils.API_DATE_FORMAT)
else:
self._add_lease_date(values, lease, 'start_date',
lease_start_date_change,
......@@ -98,5 +96,4 @@ class LeaseClientManager(base.BaseClientManager):
pos_sign=positive_delta)
date = timeutils.parse_strtime(lease[key],
utils.LEASE_DATE_FORMAT)
values[key] = timeutils.strtime(date + delta_sec,
utils.API_DATE_FORMAT)
values[key] = (date + delta_sec).strftime(utils.API_DATE_FORMAT)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment