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, :error = abort the installation ; optional



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

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

  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.



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

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.



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

def severity
  @severity
end

Instance Method Details

#messageString

Return the error message to be displayed

Returns:

  • (String)

    Error message

See Also:



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

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