Bug 710153 - cds status doesn't show status when it has a scheduled sync but if you manually run cds sync
Summary: cds status doesn't show status when it has a scheduled sync but if you manual...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: nodes
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-02 14:40 UTC by Preethi Thomas
Modified: 2012-02-24 20:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Preethi Thomas 2011-06-02 14:40:23 UTC
Description of problem:
cds status doesn't show status when it has a scheduled sync but if you manually run cds sync

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

[root@preethi ~]# rpm -q pulp
pulp-0.0.185-1.fc14.noarch

How reproducible:


Steps to Reproduce:
1. register a cds with sync schedule
2. associate a repo
3. run cds sync manually
4. check cds status



[root@preethi ~]# pulp-admin cds register --hostname=pulp-cds.usersys.redhat.com --interval PT1H --start=2011-06-02T10:00:00-05:00:00 
Successfully registered CDS [pulp-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin cds list
+------------------------------------------+
                CDS Instances
+------------------------------------------+

Name                	pulp-cds.usersys.redhat.com
Hostname            	pulp-cds.usersys.redhat.com
Description         	None                     
Group               	None                     
Sync Schedule       	2011-06-02T11:00:00-04:00/PT1H
Repos               	None                     
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-06-02 14:31:37.360490+00:00




[root@preethi ~]# pulp-admin cds status --hostname=pulp-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	pulp-cds.usersys.redhat.com
Hostname            	pulp-cds.usersys.redhat.com
Description         	None                     
Group               	None                     
Sync Schedule       	2011-06-02T11:00:00-04:00/PT1H
Repos               	None                     
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-06-02 14:36:49.947570+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+

State               	waiting                  
Start Time          	Not Started              
Finish Time         	In Progress              


[root@preethi ~]# pulp-admin cds associate_repo --hostname=pulp-cds.usersys.redhat.com --repoid=f15
Successfully associated CDS [pulp-cds.usersys.redhat.com] with repo [f15]


[root@preethi ~]# pulp-admin cds sync --hostname=pulp-cds.usersys.redhat.com
Sync for CDS [pulp-cds.usersys.redhat.com] started
Use "cds status" to check on the progress

[root@preethi ~]# pulp-admin cds status --hostname=pulp-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	pulp-cds.usersys.redhat.com
Hostname            	pulp-cds.usersys.redhat.com
Description         	None                     
Group               	None                     
Sync Schedule       	2011-06-02T11:00:00-04:00/PT1H
Repos               	f15                      
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-06-02 14:40:21.888404+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+

State               	waiting                  
Start Time          	Not Started              
Finish Time         	In Progress

Comment 1 Jay Dobies 2011-06-08 15:48:54 UTC
I think I fixed this when I added in the sort by date to the CDS status output. Please check again in QE build after .186.

Comment 2 Preethi Thomas 2011-07-21 16:23:57 UTC
fails_qa

[root@preethi ~]# rpm -q pulp
pulp-0.0.212-1.fc14.noarch
[root@preethi ~]# 

this is not fixed

[root@preethi ~]# pulp-admin cds update --hostname=pulp-cds.usersys.redhat.com --interval P1D --start=2011-07-07T00:00:00-0:6:00
Successfully updated CDS [pulp-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin cds sync --hostname=pulp-cds.usersys.redhat.com
Sync for CDS [pulp-cds.usersys.redhat.com] started
Use "cds status" to check on the progress

[root@preethi ~]# pulp-admin cds status --hostname=pulp-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	pulp-cds.usersys.redhat.com
Hostname            	pulp-cds.usersys.redhat.com
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-07-07T00:00:00-04:00/P1D
Repos               	f14                      
Last Sync           	2011-07-21 11:04:57-04:00
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-07-21 16:33:19.916754+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+

State               	Waiting                  
Start Time          	Not Started              
Finish Time         	In Progress              

[root@preethi ~]# pulp-admin cds list
+------------------------------------------+
                CDS Instances
+------------------------------------------+

Name                	pulp-cds.usersys.redhat.com
Hostname            	pulp-cds.usersys.redhat.com
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-07-07T00:00:00-04:00/P1D
Repos               	f14                      
Last Sync           	2011-07-21 11:04:57-04:00
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-07-21 16:34:00.842484+00:00

Comment 3 Jay Dobies 2011-12-07 19:58:45 UTC
I made some pretty significant changes to the CLI output. It's much more similar to RHUI in the API calls it uses now.

Notice that "Next Sync" now appears in the CDS summary when viewing its status. This will either be the next scheduled sync, "Not Scheduled" if there's no schedule, or "In Progress" if it's currently running. This field does _not_ appear on `pulp-admin cds list`.



-> pulp-admin cds register --hostname thor.marvel.u --interval P1D --start=2011-12-09T00:00:00-0:6:00
Successfully registered CDS [thor.marvel.u]




-> pulp-admin cds status --hostname thor.marvel.u+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	thor.marvel.u            
Hostname            	thor.marvel.u            
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-12-09 00:00:00-05:00
Repos               	None                     
Next Sync           	2011-12-09 05:00:00+00:00
Last Sync           	Never                    
Status:
   Responding       	No                       
   Last Heartbeat   	2011-12-07 19:54:27.574838+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+
Start Time:     2011-12-07 10:04:09-05:00
Finish Time:    2011-12-07 10:04:15-05:00
Result:         Success




-> pulp-admin cds status --hostname thor.marvel.u
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	thor.marvel.u            
Hostname            	thor.marvel.u            
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-12-09 00:00:00-05:00
Repos               	None                     
Next Sync           	2011-12-09 05:00:00+00:00
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-12-07 19:54:57.622847+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+
The CDS has not yet been synchronized





-> pulp-admin cds associate_repo --hostname thor.marvel.u --repoid fedora-64
Successfully associated CDS [thor.marvel.u] with repo [fedora-64]




-> pulp-admin cds sync --hostname thor.marvel.u
Sync for CDS [thor.marvel.u] started
Use "cds status" to check on the progress




# Note: I had done an accidental sync on the CDS before this which is why in the below screen shot it shows a completed sync.

-> pulp-admin cds status --hostname thor.marvel.u
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	thor.marvel.u            
Hostname            	thor.marvel.u            
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-12-09 00:00:00-05:00
Repos               	fedora-64                
Next Sync           	In Progress              
Last Sync           	2011-12-07 14:55:27-05:00
Status:
   Responding       	Yes                      
   Last Heartbeat   	2011-12-07 19:56:27.871544+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+
Start Time:     2011-12-07 14:55:26-05:00
Finish Time:    2011-12-07 14:55:27-05:00
Result:         Success

Comment 4 Jay Dobies 2011-12-07 20:00:42 UTC
Forgot to mention, the "Next Sync" may momentarily change to "Awaiting Execution" if it's been put on the queue but not run yet.

For what it's worth, I found it easiest to test this by opening up a second terminal and doing a watch on the status command:

watch -n 1 pulp-admin cds status --hostname thor.marvel.u

Comment 5 Jay Dobies 2011-12-07 20:04:02 UTC
commit 5fc1faa868b4155d4e7e8709ce28cb6afe1499af
Author: Jay Dobies <jason.dobies>
Date:   Wed Dec 7 15:02:11 2011 -0500

    710153 - Significant reworking of CDS status CLI command. Brought in
    line with the work done in this area on RHUI 2.0.

src/pulp/client/admin/plugins/cds.py
src/pulp/client/constants.py

Comment 6 Jeff Ortel 2011-12-15 20:18:16 UTC
build: 0.255

Comment 7 Preethi Thomas 2011-12-22 18:11:40 UTC
Fails_qa

[root@preethi ~]# pulp-admin -u admin -p admin cds update --hostname f16-cds.usersys.redhat.com --name "QE F16 CDS" --interval PT1M --start=2011-12-22T13:00:00-00:06:00
Successfully updated CDS [f16-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin -u admin -padmin cds status --hostname f16-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 23, in <module>
    admin.main()
  File "/usr/lib/python2.7/site-packages/pulp/client/lib/cli.py", line 152, in main
    command.main(self.args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 129, in main
    action.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 213, in main
    self.run()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/cds.py", line 427, in run
    _print_cds(cds, next_sync=next_sync)
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/cds.py", line 76, in _print_cds
    sync_schedule = dateutils.parse_iso8601_datetime(sync_schedule)
  File "/usr/lib/python2.7/site-packages/pulp/common/dateutils.py", line 170, in parse_iso8601_datetime
    return isodate.parse_datetime(datetime_str)
  File "/usr/lib/python2.7/site-packages/isodate/isodatetime.py", line 48, in parse_datetime
    datestring, timestring = datetimestring.split('T')
isodate.isoerror.ISO8601Error: Malformed ISO8601 date-time string: 2011-12-22T08:06:00-05:00/PT1M

Also would be good to give examples for --start and --interval values as on repo sync --help

[root@preethi ~]# pulp-admin -u admin -p admin cds update --hostname f16-cds.usersys.redhat.com --name "QE F16 CDS" --interval PT1M --start=2011-12-22T13:00:00-00:06:00
Successfully updated CDS [f16-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin -u admin -padmin cds status --hostname f16-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 23, in <module>
    admin.main()
  File "/usr/lib/python2.7/site-packages/pulp/client/lib/cli.py", line 152, in main
    command.main(self.args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 129, in main
    action.main(args[1:])
  File "/usr/lib/python2.7/site-packages/pulp/client/pluginlib/command.py", line 213, in main
    self.run()
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/cds.py", line 427, in run
    _print_cds(cds, next_sync=next_sync)
  File "/usr/lib/python2.7/site-packages/pulp/client/admin/plugins/cds.py", line 76, in _print_cds
    sync_schedule = dateutils.parse_iso8601_datetime(sync_schedule)
  File "/usr/lib/python2.7/site-packages/pulp/common/dateutils.py", line 170, in parse_iso8601_datetime
    return isodate.parse_datetime(datetime_str)
  File "/usr/lib/python2.7/site-packages/isodate/isodatetime.py", line 48, in parse_datetime
    datestring, timestring = datetimestring.split('T')
isodate.isoerror.ISO8601Error: Malformed ISO8601 date-time string: 2011-12-22T08:06:00-05:00/PT1M
[root@preethi ~]# pulp-admin -u admin -p admin cds update --help

Comment 8 Jay Dobies 2012-01-03 15:11:19 UTC
commit af01f234c6f0e794eef9a844d7b28388dff2c0e3
Author: Jay Dobies <jason.dobies>
Date:   Tue Jan 3 10:11:18 2012 -0500

    710153 - Fixed incorrect parsing of intervals in sync schedules. Added
    iso8601 format examples to --help.

src/pulp/client/admin/plugins/cds.py

Comment 9 Jeff Ortel 2012-01-04 21:48:41 UTC
build: 0.256

Comment 10 Preethi Thomas 2012-01-09 16:29:27 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.256-1.fc15.noarch

[root@preethi ~]# pulp-admin cds register --hostname=f16-cds.usersys.redhat.com --interval P1D --start=2011-01-09T12:00:00-0:6:0
Successfully registered CDS [f16-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin cds status --hostname=f16-cds.usersys.redhat.com
+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	f16-cds.usersys.redhat.com
Hostname            	f16-cds.usersys.redhat.com
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-01-09T12:00:00-05:00/P1D
Repos               	None                     
Next Sync           	2012-01-09 17:00:00+00:00
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2012-01-09 16:38:08.933320+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+
Start Time:     2011-12-22 11:59:12-05:00
Finish Time:    2011-12-22 11:59:12-05:00
Result:         Success

[root@preethi ~]# pulp-admin cds update --hostname=f16-cds.usersys.redhat.com --interval PT1M --start=2011-01-09T12:00:00-0:6:0
Successfully updated CDS [f16-cds.usersys.redhat.com]

[root@preethi ~]# pulp-admin cds status --hostname=f16-cds.usersys.redhat.com+------------------------------------------+
                 CDS Status
+------------------------------------------+

Name                	f16-cds.usersys.redhat.com
Hostname            	f16-cds.usersys.redhat.com
Description         	None                     
Cluster             	None                     
Sync Schedule       	2011-01-09T12:00:00-05:00/PT1M
Repos               	None                     
Next Sync           	2012-01-09 17:00:00+00:00
Last Sync           	Never                    
Status:
   Responding       	Yes                      
   Last Heartbeat   	2012-01-09 16:40:30.429312+00:00

+------------------------------------------+
           Most Recent Sync Tasks
+------------------------------------------+
Start Time:     2011-12-22 11:59:12-05:00
Finish Time:    2011-12-22 11:59:12-05:00
Result:         Success

[root@preethi ~]# 
[root@preethi ~]# pulp-admin cds register --help
Usage: pulp-admin <options> cds register <options>

Options:
  -h, --help            show this help message and exit
  --hostname=HOSTNAME   CDS hostname (required)
  --name=NAME           display name
  --description=DESCRIPTION
                        description of the CDS
  --cluster_id=CLUSTER_ID
                        if specified, the CDS will belong to the given cluster

  CDS Sync Schedule:
    --interval=SCHEDULE_INTERVAL
                        length of time between each run in iso8601 duration
                        format: P[n]Y[n]M[n]DT[n]H[n]M[n]S (e.g.
                        "P3Y6M4DT12H30M5S" for "three years, six months, four
                        days, twelve hours, thirty minutes, and five seconds")
    --start=SCHEDULE_START
                        date and time of the first run in iso8601 combined
                        date and time format (e.g. "2012-03-01T13:00:00Z"),
                        omitting implies starting immediately
    --runs=SCHEDULE_RUNS
                        number of times to run the scheduled sync, omitting
                        implies running indefinitely
[root@preethi ~]# pulp-admin cds update --help
Usage: pulp-admin <options> cds update <options>

Options:
  -h, --help            show this help message and exit
  --hostname=HOSTNAME   CDS hostname (required)
  --name=NAME           display name
  --description=DESCRIPTION
                        description of the CDS
  --cluster_id=CLUSTER_ID
                        assigns the CDS to the given group
  --remove_cluster      removes the CDS from a cluster if it is in one
  --remove_sync_schedule
                        removes scheduled syncs for this CDS

  CDS Sync Schedule:
    --interval=SCHEDULE_INTERVAL
                        length of time between each run in iso8601 duration
                        format: P[n]Y[n]M[n]DT[n]H[n]M[n]S (e.g.
                        "P3Y6M4DT12H30M5S" for "three years, six months, four
                        days, twelve hours, thirty minutes, and five seconds")
    --start=SCHEDULE_START
                        date and time of the first run in iso8601 combined
                        date and time format (e.g. "2012-03-01T13:00:00Z"),
                        omitting implies starting immediately
    --runs=SCHEDULE_RUNS
                        number of times to run the scheduled sync, omitting
                        implies running indefinitely

Comment 11 Preethi Thomas 2012-02-24 20:18:05 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 12 Preethi Thomas 2012-02-24 20:18:49 UTC
Pulp v1.0 is released.


Note You need to log in before you can comment on or make changes to this bug.