Bug 1914902

Summary: hammer cli --start-at not honoring iso8601 timezone
Product: Red Hat Satellite Reporter: Ram Nainsingh Tiruwa <ramsingh>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: low Docs Contact:
Priority: low    
Version: 6.8.0CC: apatel, aruzicka, kgaikwad, lstejska, ofedoren, pcreech, rabajaj
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_remote_execution-4.5.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:09:44 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:

Description Ram Nainsingh Tiruwa 2021-01-11 13:00:56 UTC
documentation claims iso8601 timezone support with hammer, but it does not.

Job created with below syntax

hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command="/bin/echo this works" --search-query "host_collection ~ test collection" --start-at "2021-01-07T14:05:00-05:00"

Below is the code for remote execution

foreman_remote_execution-3.3.7.2/app/models/job_invocation_composer.rb
...
Time.parse(datetime).strftime('%Y-%m-%d %H:%M')
...

Comment 1 Adam Ruzicka 2021-01-14 12:30:26 UTC
So what date is recorded in the end?

I would assume the snippet you provided takes the date string parses it from whatever format it is in and then once we have a time object in server's timezone, we dump it back into antoher string for further processing.

Comment 5 Peter Ondrejka 2021-08-16 13:37:55 UTC
Verified on Satellite 6.10 sn 13


~]# hammer job-invocation create --job-template "Run Command - SSH Default" --inputs command="/bin/echo this works" --search-query "..." --start-at "2021-08-16T15:36:27+02:00"
Job invocation 7 created
~]# hammer job-invocation list
---|-----------------------------------------|-----------|---------|--------|---------|-------|------------------------
ID | DESCRIPTION                             | STATUS    | SUCCESS | FAILED | PENDING | TOTAL | START                  
---|-----------------------------------------|-----------|---------|--------|---------|-------|------------------------
7  | Run /bin/echo this works                | queued    | N/A     | N/A    | N/A     | N/A   | 2021-08-16 13:36:00 UTC

Comment 8 errata-xmlrpc 2021-11-16 14:09:44 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702