Class: HammerCLIKatello::ContentViewComponentBase::ComponentUpdateCommand

Inherits:
ComponentCommand show all
Defined in:
lib/hammer_cli_katello/content_view_component.rb

Instance Method Summary collapse

Methods inherited from 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

#fetch_cvObject



42
43
44
45
46
47
48
49
50
51
# File 'lib/hammer_cli_katello/content_view_component.rb', line 42

def fetch_cv
  cv = option_content_view_id
  if cv.nil? && option_content_view_name
    cv_search_options = org_options.merge(
      HammerCLI.option_accessor_name('name') => option_content_view_name)

    cv = resolver.content_view_id(cv_search_options)
  end
  cv
end

#fetch_cvv(cv) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/hammer_cli_katello/content_view_component.rb', line 53

def fetch_cvv(cv)
  cvv = option_component_content_view_version_id
  if cvv.nil?
    if option_component_content_view_version_version && cv.nil?
      raise _("Please provide --component-content-view-id")
    end
    if option_component_content_view_version_version.nil?
      raise _("Please provide --component-content-view-version-id or" \
             " --component-content-view-version or" \
             " --latest for the latest version")
    end

    cvv_search_options = org_options.merge(
      HammerCLI.option_accessor_name("content_view_id") => cv,
      HammerCLI.option_accessor_name("version") =>
        option_component_content_view_version_version
    )

    cvv = resolver.content_view_version_id(cvv_search_options)
  end
  cvv
end