Class: Installation::AutoinstIssues::MissingValue

Inherits:
Issue
  • Object
show all
Defined in:
library/general/src/lib/installation/autoinst_issues/missing_value.rb

Overview

Represents an AutoYaST situation where a mandatory value is missing.

Examples:

Missing value for attribute 'bar' in 'foo' section.

problem = AyMissingValue.new("foo","bar")

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Issue

#fatal?, #warn?

Constructor Details

#initialize(section, attr, description = "", severity = :warn) ⇒ MissingValue

Returns a new instance of MissingValue.

Parameters:

  • section (String)

    Section where it was detected

  • attribute (String)

    Name of the missing attribute

  • description (String) (defaults to: "")

    additional explanation; optional

  • severity (Symbol) (defaults to: :warn)

    :warn, :fatal = abort the installation ; optional


36
37
38
39
40
41
42
43
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 36

def initialize(section, attr, description = "", severity = :warn)
  textdomain "base"

  @section = section
  @attribute = attr
  @description = description
  @severity = severity
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute


29
30
31
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 29

def attribute
  @attribute
end

#descriptionObject (readonly)

Returns the value of attribute description


30
31
32
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 30

def description
  @description
end

#sectionObject (readonly)

Returns the value of attribute section


29
30
31
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 29

def section
  @section
end

#severityObject (readonly)

Returns the value of attribute severity


30
31
32
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 30

def severity
  @severity
end

Instance Method Details

#messageString

Return the error message to be displayed

Returns:

  • (String)

    Error message

See Also:


49
50
51
52
53
54
# File 'library/general/src/lib/installation/autoinst_issues/missing_value.rb', line 49

def message
  # TRANSLATORS:
  # 'attr' is an AutoYaST element
  # 'description' has already been translated in other modules.
  format(_("Missing element '%{attr}'. %{description}"), attr: attribute, description: description)
end