Bug 1793501

Summary: Subscription start and end date format in JSON returned by RHSM DBus API is not consistent
Product: Red Hat Enterprise Linux 8 Reporter: Martin Kolman <mkolman>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: low Docs Contact:
Priority: high    
Version: 8.3CC: cdonnell, csnyder, jstavel, mkolman, redakkan
Target Milestone: rcKeywords: Triaged
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.28.16-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:37:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1947445, 1947447    

Description Martin Kolman 2020-01-21 13:44:27 UTC
Description of problem:
Depending on which DBus method is called, the subscription describing JSON data RHSM returns has different subscription start and end date formatting.

In output from AutoAttach() the date looks like this:
2020-11-04T04:59:59+0000

In output from GetPools() with “pool_subset” -> “consumed”  it looks like this:
11/04/2020 
or 
11/04/20

I have seen the first when calling RHSM DBuS API on an installed system while I'm getting the second one consistently in the installation environment. I guess it'S dependent on the locale, maybe even created with the locale dependent "%x" argument to strftime ? (https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes) 

Another issue is that the first format contains data about time while the other does not, so the time data might be getting lost in GetPools() output ?

In any case it would be good to have a single consistent machine readable time formatting across all the JSON data returned by RHSM, preferably using one of the ISO standards for time and date formatting, which should be nowadays widely supported by relevant C & Python libraries. This date and time format should be then also specified in the RHSM DBus API documentation.

Version-Release number of selected component (if applicable):
1.26.9-1

How reproducible:
always

Steps to Reproduce:
1. register
2. call AutoAttach() & GetPools() over DBUs

Actual results:
Returned dates are in different format.

Expected results:
All returned dates are in the same format.

Comment 10 errata-xmlrpc 2021-11-09 19:37:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (subscription-manager bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4390