Comment 1 for bug 1795513

Revision history for this message
John Fulton (jfulton-org) wrote :

Extra background info on the timestamp.

It was originally used in Queens:

 https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/files.py#L111-L112

but had to be removed in Rocky so that we could refer to the tarball with consistent GET/PUT URL:

 https://github.com/openstack/tripleo-common/commit/5a55202258c009d65885170080885d16645144ee

More info on the timestamp format below:

1. Python:
"""
(undercloud) [stack@undercloud ~]$ python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tripleo_common.utils import time_functions as timeutils
>>> 'temporary_dir-%s.tar.gz' % timeutils.timestamp()
'temporary_dir-20180915-190055.tar.gz'
>>>
"""

2. YAQL
"""
yaql> concat('temporary_dir-', now().format("%Y%m%d-%H%M%S"), '.tar.gz')
"temporary_dir-20180915-191756.tar.gz"
yaql>
"""

3. Ansible
"""
{{ ansible_date_time.date }}
{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}
{{ ansible_date_time.hour }}{{ ansible_date_time.minute }}{{ ansible_date_time.second }}
"""