Class: Puppet::Pops::Validation::TasksChecker Private

Inherits:
Checker4_0 show all
Defined in:
lib/puppet/pops/validation/tasks_checker.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Validator that limits the set of allowed expressions to not include catalog related operations

Constant Summary

Constants inherited from Checker4_0

Checker4_0::BAD_MODULE_FILE, Checker4_0::FUTURE_RESERVED_WORDS, Checker4_0::NO_NAMESPACE, Checker4_0::NO_PATH, Checker4_0::RESERVED_PARAMETERS, Checker4_0::RESERVED_TYPE_NAMES

Constants inherited from Evaluator::LiteralEvaluator

Evaluator::LiteralEvaluator::COMMA_SEPARATOR

Instance Attribute Summary

Attributes inherited from Checker4_0

#acceptor, #migration_checker

Instance Method Summary collapse

Methods inherited from Checker4_0

#assign, #assign_AccessExpression, #assign_LiteralList, #assign_Object, #assign_VariableExpression, #check, #check_AccessExpression, #check_AssignmentExpression, #check_AttributeOperation, #check_AttributesOperation, #check_BinaryExpression, #check_BlockExpression, #check_CallNamedFunctionExpression, #check_CaseExpression, #check_CaseOption, #check_EppExpression, #check_Factory, #check_FunctionDefinition, #check_HeredocExpression, #check_IfExpression, #check_KeyedEntry, #check_LambdaExpression, #check_LiteralHash, #check_LiteralInteger, #check_LiteralList, #check_MethodCallExpression, #check_NamedAccessExpression, #check_NamedDefinition, #check_Object, #check_Parameter, #check_QualifiedName, #check_QualifiedReference, #check_QueryExpression, #check_ReservedWord, #check_ResourceBody, #check_SelectorEntry, #check_SelectorExpression, #check_TypeAlias, #check_TypeDefinition, #check_TypeMapping, #check_UnaryExpression, #check_UnlessExpression, #check_VariableExpression, check_visitor, #container, #dir_to_names, #ends_with_idem, #get_module_relative_path, #hostname, #hostname_Array, #hostname_ConcatenatedString, #hostname_LiteralDefault, #hostname_LiteralNumber, #hostname_LiteralRegularExpression, #hostname_LiteralValue, #hostname_Object, #hostname_QualifiedName, #hostname_QualifiedReference, #hostname_String, #idem, #idem_AccessExpression, #idem_ApplyExpression, #idem_AssignmentExpression, #idem_BinaryExpression, #idem_BlockExpression, #idem_CaseExpression, #idem_CaseOption, #idem_ConcatenatedString, #idem_Factory, #idem_HeredocExpression, #idem_IfExpression, #idem_Literal, #idem_LiteralHash, #idem_LiteralList, #idem_MatchExpression, #idem_NilClass, #idem_Nop, #idem_Object, #idem_ParenthesizedExpression, #idem_RelationshipExpression, #idem_RenderExpression, #idem_RenderStringExpression, #idem_SelectorExpression, #idem_UnaryExpression, #initial_manifest?, #initialize, #internal_check_capture_last, #internal_check_file_namespace, #internal_check_future_reserved_word, #internal_check_illegal_assignment, #internal_check_no_capture, #internal_check_no_idem_last, #internal_check_parameter_name_uniqueness, #internal_check_reserved_params, #internal_check_reserved_type_name, #internal_check_return_type, #internal_check_top_construct_in_module, #internal_check_type_ref, #is_parent_dir_of, #namespace_for_file, #pattern_with_replacement?, #query, #query_BooleanExpression, #query_ComparisonExpression, #query_LiteralBoolean, #query_LiteralNumber, #query_LiteralString, #query_Object, #query_ParenthesizedExpression, #query_QualifiedName, #query_VariableExpression, #relation, #relation_CollectExpression, #relation_Object, #relation_RelationshipExpression, #rvalue, #rvalue_CollectExpression, #rvalue_Definition, #rvalue_Expression, #rvalue_NodeDefinition, #rvalue_UnaryExpression, #top, #type_ref?, #valid_top_construct?, #validate, #varname_to_s

Methods included from Evaluator::ExternalSyntaxSupport

#assert_external_syntax, #checker_for_syntax, #lookup_keys_for_syntax

Methods inherited from Evaluator::LiteralEvaluator

#initialize, #literal, #literal_ConcatenatedString, #literal_Factory, #literal_LiteralBoolean, #literal_LiteralDefault, #literal_LiteralHash, #literal_LiteralList, #literal_LiteralNumber, #literal_LiteralRegularExpression, #literal_LiteralString, #literal_LiteralUndef, #literal_Object, #literal_Program, #literal_QualifiedName

Constructor Details

This class inherits a constructor from Puppet::Pops::Validation::Checker4_0

Instance Method Details

#check_Application(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 16

def check_Application(o)
  illegalTasksExpression(o)
end

#check_ApplyExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



86
87
88
89
90
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 86

def check_ApplyExpression(o)
  if in_ApplyExpression?
    acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_COMPILING, o, {:klass => o})
  end
end

#check_CapabilityMapping(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



20
21
22
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 20

def check_CapabilityMapping(o)
  illegalTasksExpression(o)
end

#check_CollectExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 24

def check_CollectExpression(o)
  # Only virtual resource queries are allowed in apply blocks, not exported
  # resource queries
  if in_ApplyExpression?
    if o.query.is_a?(Puppet::Pops::Model::VirtualQuery)
      super(o)
    else
      acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_COMPILING, o, {:klass => o})
    end
  else
    illegalTasksExpression(o)
  end
end

#check_HostClassDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



38
39
40
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 38

def check_HostClassDefinition(o)
  illegalTasksExpression(o)
end

#check_NodeDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



42
43
44
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 42

def check_NodeDefinition(o)
  illegalTasksExpression(o)
end

#check_RelationshipExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



46
47
48
49
50
51
52
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 46

def check_RelationshipExpression(o)
  if in_ApplyExpression?
    super(o)
  else
    illegalTasksExpression(o)
  end
end

#check_ResourceDefaultsExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



54
55
56
57
58
59
60
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 54

def check_ResourceDefaultsExpression(o)
  if in_ApplyExpression?
    super(o)
  else
    illegalTasksExpression(o)
  end
end

#check_ResourceExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



62
63
64
65
66
67
68
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 62

def check_ResourceExpression(o)
  if in_ApplyExpression?
    super(o)
  else
    illegalTasksExpression(o)
  end
end

#check_ResourceOverrideExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



70
71
72
73
74
75
76
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 70

def check_ResourceOverrideExpression(o)
  if in_ApplyExpression?
    super(o)
  else
    illegalTasksExpression(o)
  end
end

#check_ResourceTypeDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



78
79
80
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 78

def check_ResourceTypeDefinition(o)
  illegalTasksExpression(o)
end

#check_SiteDefinition(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



82
83
84
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 82

def check_SiteDefinition(o)
  illegalTasksExpression(o)
end

#illegalTasksExpression(o) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



92
93
94
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 92

def illegalTasksExpression(o)
  acceptor.accept(Issues::EXPRESSION_NOT_SUPPORTED_WHEN_SCRIPTING, o, {:klass => o})
end

#in_ApplyExpression?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 7

def in_ApplyExpression?
  top = container(0)
  step = -1
  until container(step) == top do
    return true if container(step).is_a? Puppet::Pops::Model::ApplyBlockExpression
    step -= 1
  end
end

#resource_without_title?(o) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


96
97
98
# File 'lib/puppet/pops/validation/tasks_checker.rb', line 96

def resource_without_title?(o)
  false
end