mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Replace "*_date_iso" with "*_date" and use Unix time as "*_date_time_t"
This commit is contained in:
parent
b2b21f877a
commit
7edb0e8f3f
1 changed files with 4 additions and 1 deletions
|
@ -488,9 +488,12 @@ def info(*packages, **attr):
|
|||
pkg_name = value
|
||||
if key in ['build_date', 'install_date']:
|
||||
try:
|
||||
pkg_data['{0}_iso'.format(key)] = datetime.datetime.fromtimestamp(int(value)).isoformat()
|
||||
value = int(value)
|
||||
pkg_data['{0}_time_t'.format(key)] = value
|
||||
value = datetime.datetime.fromtimestamp(value).isoformat()
|
||||
except ValueError:
|
||||
log.warning('Could not convert "{0}" into Unix time'.format(value))
|
||||
continue
|
||||
if key not in ['description', 'name'] and value:
|
||||
pkg_data[key] = value
|
||||
if filter_attrs and 'description' in filter_attrs or not filter_attrs:
|
||||
|
|
Loading…
Add table
Reference in a new issue