New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #12405: move packages from system to host. #5656
Conversation
a675869
to
ec2a068
Compare
7f0ccda
to
bea37f7
Compare
@system = System.where(:uuid => params[:system_id]).first | ||
fail HttpErrors::NotFound, _("Couldn't find system '%s'") % params[:system_id] if @system.nil? | ||
@system = System.where(:host_id => params[:host_id]).first | ||
fail HttpErrors::NotFound, _("Couldn't find system with host id '%s'") % params[:host_id] if @system.nil? |
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.
Should this be Couldn't find host
?
Associated hammer pr: Katello/hammer-cli-katello#340 |
4077c44
to
62075b8
Compare
def find_host | ||
@host = ::Host::Managed.find(params[:host_id]) | ||
fail HttpErrors::NotFound, _("Couldn't find host with host id '%s'") % params[:host_id] if @host.nil? | ||
@host | ||
end |
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 check here to verify the host has a content facet and a uuid in that content facet (implying its registered via pulp)
@ehelms @jlsherrill updated. |
825e8e4
to
ed11696
Compare
@jlsherrill updated. |
fail HttpErrors::NotFound, _("Couldn't find system '%s'") % params[:system_id] if @system.nil? | ||
@system | ||
def find_host | ||
@host = ::Host::Managed.find(params[:host_id]) |
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.
As mentioned in your other PR, this doesn't properly check authorization
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.
This looks like its still not properly authorizing
Also discovered that we need something like this:
in any controller that is under /api/hosts (and not under /katello/api) |
See https://github.com/Katello/katello/pull/5656/files#diff-c488bbb43ed74b3c1446892671b7afe8R7 |
f4100bb
to
cc30233
Compare
@jlsherrill updated. |
query = @host.installed_packages | ||
collection = scoped_search(query.uniq, :name, :asc, :resource_class => ::Katello::InstalledPackage) | ||
respond_for_index(:collection => collection) | ||
end |
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.
would you be up for adding auto-complete support. Its really easy! :)
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.
Added.
Everything else looks great and works fine. After those 3 fixes I think its good to go. |
@jlsherrill updated. |
ACK |
Fixes #12405: move packages from system to host.
http://projects.theforeman.org/issues/12405
Do not merge until this PR has an associated ACK'd hammer PR.