Skip to content

Commit

Permalink
795780 - Sync status page will not appropriately display completed and
Browse files Browse the repository at this point in the history
queued repositories and show progress for syncs that are started on
queued repositories.
(cherry picked from commit 117b056)
  • Loading branch information
ehelms committed Mar 2, 2012
1 parent 92cd64a commit 114d168
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/lib/resources/pulp.rb
Expand Up @@ -282,17 +282,15 @@ def sync_status(repo_id)
response = get(path, self.default_headers)
parsed = JSON.parse(response.body)

parsed.reject!{ |task| task['start_time'].nil? }

return parsed if parsed.empty?

parsed.sort!{|a,b|
if a['finish_time'].nil? && b['finish_time'].nil?
a['start_time'] <=> b['start_time']
b['start_time'] <=> a['start_time']
elsif a['finish_time'].nil?
-1
elsif b['finish_time'].nil?
1
elsif b['finish_time'].nil?
-1
else
b['finish_time'] <=> a['finish_time']
end
Expand Down

0 comments on commit 114d168

Please sign in to comment.