Class: HammerCLIKatello::ContentViewComponent::UpdateCommand

Inherits:
HammerCLIKatello::ContentViewComponentBase::ComponentUpdateCommand show all
Defined in:
lib/hammer_cli_katello/content_view_component.rb

Instance Method Summary collapse

Methods inherited from HammerCLIKatello::ContentViewComponentBase::ComponentUpdateCommand

#fetch_cv, #fetch_cvv

Methods inherited from HammerCLIKatello::ContentViewComponentBase::ComponentCommand

#get_component_by_name_or_id, #get_components

Methods included from HammerCLIKatello::CompositeContentViewNameResolvable

#composite_content_view_resolve_options, included, #options

Methods included from OrganizationOptions

included, #org_options

Methods included from ResolverCommons

included

Instance Method Details

#request_paramsObject



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/hammer_cli_katello/content_view_component.rb', line 157

def request_params
  super.tap do |opts|
    cv = fetch_cv
    opts["content_view_id"] = cv if cv
    update_id(opts)

    if option_latest?
      opts["latest"] = true
      opts.delete("content_view_version_id")
    else
      opts["latest"] = false
      opts["content_view_version_id"] = fetch_cvv(opts["content_view_id"])
    end
  end
end

#update_id(opts) ⇒ Object



148
149
150
151
152
153
154
155
# File 'lib/hammer_cli_katello/content_view_component.rb', line 148

def update_id(opts)
  return if opts["id"] || opts["content_view_id"].nil? ||
            opts["composite_content_view_id"].nil?

  component = get_component_by_name_or_id(opts["composite_content_view_id"],
                                    :id => opts["content_view_id"])
  opts["id"] = component["id"] if component
end