-
Notifications
You must be signed in to change notification settings - Fork 7
show a warning after host creation/update if not all repositoires are av... #29
base: master
Are you sure you want to change the base?
Conversation
def verify_repository_status | ||
return if new_record? || !built? | ||
@host.attached_repositories.each do |r| | ||
flash[:warning] = "Repository '#{r.name}' is not ready to be used." unless r.sync_status.synced? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rescue if pulp is not reachable?
this could be very confusing error message if all you do is set build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw: another reason to keep that status in our db.
@ohadlevy: re confusing message - agree, but not sure what else we can do atm. There are a few issues here, akward warning, tftp server gets pxe-boot file for the host, etc. I think you are right re: keeping a local copy of the repository state. I also think we need a bit more - an FSM for entities like hosts, repositories, etc, and ability to trigger state changes asynchronously (for example on callback from pulp). In this case the host would stay in "PENDING" state until repository synchronization completes (or fails). |
def verify_repository_status | ||
return if new_record? || !built? | ||
@host.attached_repositories.each do |r| | ||
flash[:warning] = "Repository '#{r.name}' is not ready to be used." unless (r.sync_status.synced? rescue true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a rescue here not to fail the entire operation.
Do you think it make sense to wait until we keep the repo publish state in the db? |
Should we introduce an FSM for hosts and repositories? |
thats a much larger discussion imho, I would start with smaller changes :) |
...ailable yet