Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

show a warning after host creation/update if not all repositoires are av... #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

show a warning after host creation/update if not all repositoires are av... #29

wants to merge 2 commits into from

Conversation

dmitri-d
Copy link
Member

@dmitri-d dmitri-d commented Aug 1, 2013

...ailable yet

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?
Copy link
Member

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

Copy link
Member

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.

@dmitri-d
Copy link
Member Author

dmitri-d commented Aug 2, 2013

@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)
Copy link
Member

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.

@ohadlevy
Copy link
Member

ohadlevy commented Aug 5, 2013

Do you think it make sense to wait until we keep the repo publish state in the db?

@dmitri-d
Copy link
Member Author

dmitri-d commented Aug 5, 2013

Should we introduce an FSM for hosts and repositories?

@ohadlevy
Copy link
Member

ohadlevy commented Aug 6, 2013

thats a much larger discussion imho, I would start with smaller changes :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants