Bug 783124

Summary: After defining the sync plan, the 'sync plan list' shows incorrect start date/time.
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: APIAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0Keywords: Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-cli-0.1.48-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:21:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 747354    
Attachments:
Description Flags
UI is showing correct sync start date/time
none
Incorrect sync time on UI after defining sync plan from cli. none

Description Sachin Ghai 2012-01-19 13:05:34 UTC
Description of problem:
I created a sync plan as below:

katello> sync_plan create --name sync_f15 --org sghai_org  --interval hourly --date 2012-01-20 --time 22:30:00
Successfully created environment [ sync_f15 ]

Please note that here:
- start date is 2012-01-20 and 
- time is 22:30 ( 10:30 PM )


sync plan list:
===============
katello> sync_plan list --org sghai_org
-----------------------------------------------------------------------------
                               Sync Plan List

 Id   Name       Description   Start Date            Interval  
-----------------------------------------------------------------------------
 1    sync_f15   None          2012/01/21 04:00:00   hourly    


Please note that in "sync_plan list", date/time both get changed. however it should be similar to what we define in sync_plan create.

Version-Release number of selected component (if applicable):
[root@dhcp201-163 f15]# rpm -qa | grep -ie katello-0 -ie pulp-0
pulp-0.0.258-1.el6.noarch
katello-0.1.178-1.el6.noarch
katello-glue-pulp-0.1.178-1.el6.noarch
[root@dhcp201-163 f15]# 


How reproducible:
always

Steps to Reproduce:
1. Create sync plan
2. list sync_plan
3.
  
Actual results:
Sync_plan list shows different sync start date/time from what we have defined at the time of creation

Expected results:
Should be same.

Additional info:

Comment 1 Sachin Ghai 2012-01-19 13:07:11 UTC
Created attachment 556268 [details]
UI is showing correct sync start date/time

Comment 4 Sachin Ghai 2012-01-30 10:43:14 UTC
Hi Tomas, I don't have the machine where I tested this earlier. However I tried to retest this again and this time I found half an hour difference.

I defined the time 22:30 ( 10:30 PM), however 'list' cmd showing 23:00 (11 PM).



[root@dhcp201-143 ~]# katello -u admin -p admin shell
katello> sync_plan create --name sync_pulpy --org ACME_Corporation --interval hourly --date 2012-01-30 --time 22:30:00
Successfully created environment [ sync_pulpy ]


katello> sync_plan list --org ACME_Corporation
--------------------------------------------------------------------------------
                                 Sync Plan List

 Id   Name         Description   Start Date            Interval  
--------------------------------------------------------------------------------
 1    sync_pulpy   None          2012/01/30 23:00:00   hourly    
katello> exit

[root@dhcp201-143 ~]# date
Mon Jan 30 15:58:40 IST 2012


I retested this with:
[root@dhcp201-143 ~]# rpm -qa | grep -ie katello-0 -ie katello-cli-0 -ie pulp-0
pulp-0.0.261-1.el6.noarch
katello-cli-0.1.42-1.el6.noarch
katello-0.1.195-1.el6.noarch

Comment 5 Sachin Ghai 2012-01-30 10:46:18 UTC
Also as you suggested  I tried to pass timezone (IST) as in input. 

Here I input the sync time 22:30 (10:30 PM IST)

However, the 'list' command again showing 30 min difference. Showing 22:00 (10PM) 

katello> sync_plan create --name sync_pulp --org ACME_Corporation --interval hourly --date 2012-01-30 --time 22:30:00 IST
Successfully created environment [ sync_pulp ]

katello> sync_plan list --org ACME_Corporation--------------------------------------------------------------------------------
                                 Sync Plan List

 Id   Name         Description   Start Date            Interval  
--------------------------------------------------------------------------------
 1    sync_pulpy   None          2012/01/30 23:00:00   hourly    
 2    sync_pulp    None          2012/01/30 22:00:00   hourly    
katello> 


Please suggest if I'm missing anything here.

Comment 6 Tomas Strachota 2012-01-30 13:54:35 UTC
There was one more problem with half hour time shifts. Fixed in katello-cli-0.1.48-1

Testing notes:
- when you don't enter the timezone, your local timezone is assumed
- if you want to enter the timezone, the format is 00:00:00+01:30 (abbreviations like IST won't work)

Comment 7 Sachin Ghai 2012-01-31 08:01:22 UTC
Verified with following katello build:

katello-0.1.206-1.el6.noarch
pulp-0.0.263-1.el6.noarch
katello-cli-0.1.48-1.el6.noarch

sync plan with passing timezone: Input time 14:30 and displayed correctly as 14:30
===============================

katello> sync_plan create --name sync_pulp --org ACME_Corporation --interval daily --date 2012-01-31 --time 14:30:00+05:30 
Successfully created environment [ sync_pulp ]


katello> sync_plan list --org ACME_Corporation
------------------------------------------------------------------
                          Sync Plan List

 Id   Name        Description   Start Date            Interval  
------------------------------------------------------------------
 1    sync_pulp   None          2012/01/31 14:30:00   daily     
katello> 


I also tried without passing the timezone with time as below:


sync_plan without passing Timezone:
======================================

katello> sync_plan create --name sync_pulp_notz --org ACME_Corporation --interval daily --date 2012-01-31 --time 14:30:00
Successfully created environment [ sync_pulp_notz ]



katello> sync_plan list --org ACME_Corporation------------------------------------------------------------------
                          Sync Plan List

 Id   Name             Description   Start Date            Interval  
------------------------------------------------------------------
 1    sync_pulp        None          2012/01/31 14:30:00   daily     
 2    sync_pulp_notz   None          2012/01/31 14:30:00   daily     



However this time UI is showing incorrect time and in both cases (9:00 AM).

Comment 8 Sachin Ghai 2012-01-31 08:03:25 UTC
Created attachment 558557 [details]
Incorrect sync time on UI after defining sync plan from cli.

Comment 9 Sachin Ghai 2012-01-31 08:05:53 UTC
Hi Tomas. Thanks for fixing this bug from cli.. however now I'm finding incorrect time on UI. not sure if its related to change in cli.

Comment 10 Tomas Strachota 2012-01-31 09:51:29 UTC
It's the timezone trick again. UI presents (and expects!) all times as GMT while CLI uses local.  We have to solve this confusing inconsistency.

Comment 11 Sachin Ghai 2012-01-31 12:58:49 UTC
As per comment7, sync_plan list is correctly showing the sync time.. So moving this defect to verified state. However there is still an issue with UI as time sync time in cli is not consistent with UI. 

As per IRC chat.. Tomas is logging another defect for UI. So moving this to verified.