module Puppet::Pops::Issues

Defines classes to deal with issues, and message formatting and defines constants with Issues. @api public

Constants

APPENDS_DELETES_NO_LONGER_SUPPORTED
BAD_ARRAY_SLICE_ARITY
BAD_COLLECTION_SLICE_TYPE
BAD_FLOAT_SLICE_ARITY
BAD_FLOAT_SLICE_TYPE
BAD_HASH_SLICE_ARITY
BAD_INTEGER_SLICE_ARITY
BAD_INTEGER_SLICE_TYPE
BAD_NOT_UNDEF_SLICE_TYPE
BAD_SLICE_KEY_TYPE
BAD_STRING_SLICE_ARITY
BAD_STRING_SLICE_TYPE
BAD_TYPE_SLICE_ARITY
BAD_TYPE_SLICE_TYPE
BAD_TYPE_SPECIALIZATION
CAPTURES_REST_NOT_LAST
CAPTURES_REST_NOT_SUPPORTED
COMPARISON_NOT_POSSIBLE
CROSS_SCOPE_ASSIGNMENT
DISCONTINUED_IMPORT
DIV_BY_ZERO
DUPLICATE_ATTRIBUTE
DUPLICATE_PARAMETER
DUPLICATE_TITLE
EMPTY_HEREDOC_SYNTAX_SEGMENT

TODO_HEREDOC

EMPTY_RESOURCE_SPECIALIZATION
EMPTY_STRING_TITLE_AT
EPP_INTERNAL_ERROR
EPP_UNBALANCED_COMMENT
EPP_UNBALANCED_EXPRESSION
EPP_UNBALANCED_TAG
FUTURE_RESERVED_WORD
HEREDOC_INVALID_ESCAPE
HEREDOC_INVALID_SYNTAX
HEREDOC_MULTIPLE_AT_ESCAPES
HEREDOC_UNCLOSED_PARENTHESIS
HEREDOC_WITHOUT_END_TAGGED_LINE
HEREDOC_WITHOUT_TEXT
IDEM_EXPRESSION_NOT_LAST
IDEM_NOT_ALLOWED_LAST
ILLEGAL_ASSIGNMENT

Assignment can only be made to certain types of left hand expressions such as variables.

ILLEGAL_ASSIGNMENT_VIA_INDEX

When indexed assignment ($x[]=) is allowed, the leftmost expression must be a variable expression.

ILLEGAL_ATTRIBUTE_APPEND

Appending to attributes is only allowed in certain types of resource expressions.

ILLEGAL_CLASSREF

In case a model is constructed programmatically, it must create valid type references.

ILLEGAL_CLASS_REFERENCE
ILLEGAL_DEFINITION_NAME
ILLEGAL_EPP_PARAMETERS
ILLEGAL_EXPRESSION

Issues when an expression is used where it is not legal. E.g. an arithmetic expression where a hostname is expected.

ILLEGAL_FULLY_QUALIFIED_CLASS_REFERENCE
ILLEGAL_FULLY_QUALIFIED_NAME
ILLEGAL_HOSTCLASS_NAME
ILLEGAL_HOSTNAME_CHARS

A hostname may only contain letters, digits, ‘_’, ‘-’, and ‘.’.

ILLEGAL_HOSTNAME_INTERPOLATION

A hostname may only contain letters, digits, ‘_’, ‘-’, and ‘.’.

ILLEGAL_INDEXED_ASSIGNMENT

In certain versions of Puppet it may be allowed to assign to a not already assigned key in an array or a hash. This is an optional validation that may be turned on to prevent accidental mutation.

ILLEGAL_NAME
ILLEGAL_NAME_OR_BARE_WORD
ILLEGAL_NODE_INHERITANCE
ILLEGAL_NUMBER
ILLEGAL_NUMERIC_ASSIGNMENT

Assignment cannot be made to numeric match result variables

ILLEGAL_NUMERIC_PARAMETER

parameters cannot have numeric names, clashes with match result variables

ILLEGAL_NUMERIC_VAR_NAME
ILLEGAL_OVERRIDEN_TYPE
ILLEGAL_PARAM_NAME
ILLEGAL_QUERY_EXPRESSION

Issues when an expression is used illegaly in a query. query only supports == and !=, and not <, > etc.

ILLEGAL_REASSIGNMENT

Variables are immutable, cannot reassign in the same assignment scope

ILLEGAL_RELATIONSHIP_OPERAND_TYPE
ILLEGAL_RESERVED_ASSIGNMENT
ILLEGAL_RESOURCE_SPECIALIZATION
ILLEGAL_RESOURCE_TYPE
ILLEGAL_TITLE_TYPE_AT
ILLEGAL_TYPE_SPECIALIZATION
ILLEGAL_UNICODE_ESCAPE
ILLEGAL_VARIABLE_EXPRESSION

Issues when a variable is not a NAME

ILLEGAL_VAR_NAME
INVALID_DECIMAL_NUMBER
INVALID_HEX_NUMBER
INVALID_OCTAL_NUMBER
MATCH_NOT_REGEXP
MATCH_NOT_STRING
MISSING_REQUIRED_PARAMETER
MISSING_TITLE
MISSING_TITLE_AT
MULTIPLE_ATTRIBUTES_UNFOLD
NAME_WITH_HYPHEN

This is allowed (3.1) and has not yet been deprecated. @todo configuration

NOT_CATALOG_TYPE
NOT_NUMERIC
NOT_RVALUE

Some expressions/statements may not produce a value (known as right-value, or rvalue). This may vary between puppet versions.

NOT_TOP_LEVEL

A class, definition, or node may only appear at top level or inside other classes @todo Is this really true for nodes? Can they be inside classes? Isn’t that too late? @api public

NOT_VIRTUALIZEABLE

If an attempt is made to make a resource default virtual or exported.

NO_INPUT_TO_LEXER
OPERATOR_NOT_APPLICABLE

For non applicable operators (e.g. << on Hash).

REQUIRED_PARAMETER_AFTER_OPTIONAL
RESERVED_PARAMETER
RESERVED_TYPE_NAME
RESERVED_WORD
RESULT_IS_INFINITY
RT_NO_STORECONFIGS

This is a runtime issue - storeconfigs must be on in order to collect exported. This issue should be set to :ignore when just checking syntax. @todo should be a :warning by default

RT_NO_STORECONFIGS_EXPORT

This is a runtime issue - storeconfigs must be on in order to export a resource. This issue should be set to :ignore when just checking syntax. @todo should be a :warning by default

RUNTIME_ERROR
SYNTAX_ERROR
TYPE_MISMATCH
UNCLOSED_QUOTE
UNKNOWN_FUNCTION
UNKNOWN_RESOURCE
UNKNOWN_RESOURCE_PARAMETER
UNKNOWN_RESOURCE_TYPE
UNKNOWN_VARIABLE
UNMATCHED_SELECTOR
UNRECOGNIZED_ESCAPE
UNSUPPORTED_OPERATOR

For unsupported operators (e.g. += and -= in puppet 4).

UNSUPPORTED_OPERATOR_IN_CONTEXT

For operators that are not supported in specific contexts (e.g. ‘* =>’ in resource defaults)

UNSUPPORTED_RANGE

When an attempt is made to use multiple keys (to produce a range in Ruby - e.g. $arr). This is not supported in 3x, but it allowed in 4x.

VAR_WITH_HYPHEN

When a variable name contains a hyphen and these are illegal. It is possible to control if a hyphen is legal in a name or not using the setting TODO @todo describe the setting @api public @todo configuration if this is error or warning

Public Class Methods

hard_issue(issue_code, *args, &block) click to toggle source

Creates a non demotable issue. @see Issue.issue

# File lib/puppet/pops/issues.rb, line 126
def self.hard_issue(issue_code, *args, &block)
  result = Issue.new(issue_code, *args, &block)
  result.demotable = false
  result
end
issue(issue_code, *args, &block) click to toggle source

Defines an issue with the given `issue_code`, additional required parameters, and a block producing a message. The block is evaluated in the context of a MessageData which provides convenient access to all required arguments via accessor methods. In addition to accessors for specified arguments, these are also available:

  • `label` - a `LabelProvider` that provides human understandable names for model elements and production of article (a/an/the).

  • `semantic` - the model element for which the issue is reported

@param issue_code [Symbol] the issue code for the issue used as an identifier, should be the same as the constant

the issue is bound to.

@param args [Symbol] required arguments that must be passed when formatting the message, may be empty @param block [Proc] a block producing the message string, evaluated in a MessageData scope. The produced string

should not end with a period as additional information may be appended.

@see MessageData @api public

# File lib/puppet/pops/issues.rb, line 119
def self.issue (issue_code, *args, &block)
  Issue.new(issue_code, *args, &block)
end