bolt 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bolt might be problematic. Click here for more details.

Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bolt/cli.rb +65 -28
  3. data/lib/bolt/config.rb +18 -8
  4. data/lib/bolt/executor.rb +21 -6
  5. data/lib/bolt/node.rb +3 -0
  6. data/lib/bolt/node/result.rb +5 -0
  7. data/lib/bolt/node/ssh.rb +81 -25
  8. data/lib/bolt/node/winrm.rb +70 -31
  9. data/lib/bolt/notifier.rb +20 -0
  10. data/lib/bolt/outputter.rb +21 -0
  11. data/lib/bolt/outputter/human.rb +30 -0
  12. data/lib/bolt/outputter/json.rb +51 -0
  13. data/lib/bolt/result.rb +32 -5
  14. data/lib/bolt/version.rb +1 -1
  15. data/vendored/puppet/lib/puppet.rb +4 -5
  16. data/vendored/puppet/lib/puppet/agent.rb +22 -2
  17. data/vendored/puppet/lib/puppet/application/agent.rb +1 -1
  18. data/vendored/puppet/lib/puppet/application/apply.rb +1 -1
  19. data/vendored/puppet/lib/puppet/configurer/downloader_factory.rb +10 -0
  20. data/vendored/puppet/lib/puppet/configurer/plugin_handler.rb +4 -4
  21. data/vendored/puppet/lib/puppet/defaults.rb +21 -2
  22. data/vendored/puppet/lib/puppet/external/nagios/parser.rb +1 -1
  23. data/vendored/puppet/lib/puppet/file_serving/configuration.rb +3 -0
  24. data/vendored/puppet/lib/puppet/file_serving/configuration/parser.rb +2 -0
  25. data/vendored/puppet/lib/puppet/file_serving/mount/locales.rb +35 -0
  26. data/vendored/puppet/lib/puppet/forge.rb +9 -3
  27. data/vendored/puppet/lib/puppet/forge/repository.rb +1 -1
  28. data/vendored/puppet/lib/puppet/functions/file_upload.rb +20 -15
  29. data/vendored/puppet/lib/puppet/functions/new.rb +1 -4
  30. data/vendored/puppet/lib/puppet/functions/run_command.rb +15 -13
  31. data/vendored/puppet/lib/puppet/functions/run_script.rb +27 -14
  32. data/vendored/puppet/lib/puppet/functions/run_task.rb +21 -19
  33. data/vendored/puppet/lib/puppet/gettext/config.rb +86 -28
  34. data/vendored/puppet/lib/puppet/indirector/catalog/compiler.rb +25 -5
  35. data/vendored/puppet/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
  36. data/vendored/puppet/lib/puppet/module.rb +13 -17
  37. data/vendored/puppet/lib/puppet/pops/evaluator/access_operator.rb +20 -21
  38. data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +3 -3
  39. data/vendored/puppet/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -0
  40. data/vendored/puppet/lib/puppet/pops/loader/static_loader.rb +20 -1
  41. data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +2 -1
  42. data/vendored/puppet/lib/puppet/pops/loaders.rb +6 -41
  43. data/vendored/puppet/lib/puppet/pops/pcore.rb +9 -0
  44. data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
  45. data/vendored/puppet/lib/puppet/pops/serialization/json_path.rb +2 -1
  46. data/vendored/puppet/lib/puppet/pops/types/execution_result.rb +7 -4
  47. data/vendored/puppet/lib/puppet/pops/types/p_binary_type.rb +9 -2
  48. data/vendored/puppet/lib/puppet/pops/types/p_init_type.rb +1 -1
  49. data/vendored/puppet/lib/puppet/pops/types/p_meta_type.rb +4 -0
  50. data/vendored/puppet/lib/puppet/pops/types/p_object_type.rb +81 -4
  51. data/vendored/puppet/lib/puppet/pops/types/p_object_type_extension.rb +213 -0
  52. data/vendored/puppet/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
  53. data/vendored/puppet/lib/puppet/pops/types/puppet_object.rb +11 -1
  54. data/vendored/puppet/lib/puppet/pops/types/type_calculator.rb +2 -2
  55. data/vendored/puppet/lib/puppet/pops/types/type_factory.rb +16 -6
  56. data/vendored/puppet/lib/puppet/pops/types/type_formatter.rb +22 -14
  57. data/vendored/puppet/lib/puppet/pops/types/type_parser.rb +17 -15
  58. data/vendored/puppet/lib/puppet/pops/types/types.rb +181 -72
  59. data/vendored/puppet/lib/puppet/provider.rb +18 -8
  60. data/vendored/puppet/lib/puppet/provider/package/yum.rb +22 -7
  61. data/vendored/puppet/lib/puppet/provider/service/base.rb +21 -8
  62. data/vendored/puppet/lib/puppet/provider/service/launchd.rb +2 -3
  63. data/vendored/puppet/lib/puppet/provider/user/aix.rb +1 -0
  64. data/vendored/puppet/lib/puppet/provider/user/user_role_add.rb +7 -1
  65. data/vendored/puppet/lib/puppet/provider/user/useradd.rb +3 -2
  66. data/vendored/puppet/lib/puppet/provider/zfs/zfs.rb +5 -1
  67. data/vendored/puppet/lib/puppet/type/exec.rb +5 -4
  68. data/vendored/puppet/lib/puppet/type/macauthorization.rb +1 -1
  69. data/vendored/puppet/lib/puppet/type/user.rb +19 -0
  70. data/vendored/puppet/lib/puppet/util/log/destinations.rb +10 -0
  71. data/vendored/puppet/lib/puppet/util/windows/file.rb +35 -4
  72. data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +1 -1
  73. data/vendored/puppet/lib/puppet/version.rb +1 -1
  74. data/vendored/puppet/lib/puppet_pal.rb +15 -5
  75. metadata +8 -3
  76. data/vendored/puppet/lib/puppet/pops/types/p_error_type.rb +0 -158
@@ -1,158 +0,0 @@
1
- module Puppet::Pops
2
- module Types
3
- class PErrorType < PAnyType
4
- DEFAULT_ISSUE_CODE = 'ERROR'.freeze
5
-
6
- class Error
7
- include PuppetObject
8
-
9
- attr_reader :message, :kind, :issue_code, :partial_result, :details
10
-
11
- def self._pcore_type
12
- return PErrorType::DEFAULT
13
- end
14
-
15
- def self.from_hash(hash)
16
- self.new(hash['message'], hash['kind'], hash['issue_code'] || DEFAULT_ISSUE_CODE, hash['partial_result'], hash['details'])
17
- end
18
-
19
- def initialize(message, kind = nil, issue_code = DEFAULT_ISSUE_CODE, partial_result = nil, details = nil)
20
- @issue_code = issue_code
21
- @kind = kind
22
- @message = message
23
- @partial_result = partial_result
24
- @details = details
25
- end
26
-
27
- def to_s
28
- s = 'Error('
29
- s << StringConverter.convert(_pcore_init_hash, '%p')
30
- s << ')'
31
- s
32
- end
33
-
34
- def _pcore_type
35
- return PErrorType.new(@kind.nil? ? nil : PStringType.new(@kind), @issue_code.nil? ? nil : PStringType.new(@issue_code))
36
- end
37
-
38
- def _pcore_init_hash
39
- hash = {
40
- 'message' => @message,
41
- }
42
- hash['kind'] = @kind unless @kind.nil?
43
- hash['issue_code'] = @issue_code unless @issue_code.nil?
44
- hash['partial_result'] = @partial_result unless @partial_result.nil?
45
- hash['details'] = @details unless @details.nil?
46
- hash
47
- end
48
- end
49
-
50
- TYPE_ERROR_TYPE_PARAM = PVariantType.new([PTypeType.new(PEnumType::DEFAULT), PTypeType.new(PPatternType::DEFAULT)])
51
- TYPE_ERROR_PARAM = PVariantType.new([PUndefType::DEFAULT, PDefaultType::DEFAULT, PRegexpType::DEFAULT, PStringType::DEFAULT, TYPE_ERROR_TYPE_PARAM])
52
-
53
- def self.register_ptype(loader, ir)
54
- create_ptype(loader, ir, 'AnyType',
55
- 'kind' => { KEY_TYPE => TYPE_ERROR_PARAM, KEY_VALUE => nil },
56
- 'issue_code' => { KEY_TYPE => TYPE_ERROR_PARAM, KEY_VALUE => nil }
57
- )
58
- end
59
-
60
- def self.new_function(type)
61
- @new_function ||= Puppet::Functions.create_loaded_function(:new_error, type.loader) do
62
- dispatch :create do
63
- param 'String[1]', :message
64
- optional_param 'Optional[String[1]]', :kind
65
- optional_param 'Optional[String[1]]', :issue_code
66
- optional_param 'Data', :partial_result
67
- optional_param 'Optional[DataHash]', :details
68
- end
69
-
70
- dispatch :from_hash do
71
- param 'Struct[message => String[1], Optional[kind] => String[1], Optional[issue_code] => String[1], Optional[partial_result] => Data, Optional[details] => DataHash]', :hash
72
- end
73
-
74
- def from_hash(hash)
75
- Error.from_hash(hash)
76
- end
77
-
78
- def create(message, kind = nil, issue_code = nil, partial_result = nil, details = nil)
79
- issue_code = DEFAULT_ISSUE_CODE if issue_code.nil?
80
- Error.new(message, kind, issue_code, partial_result, details)
81
- end
82
- end
83
- end
84
-
85
- attr_reader :kind, :issue_code
86
-
87
- def initialize(kind = nil, issue_code = nil)
88
- @kind = convert_arg(kind)
89
- @issue_code = convert_arg(issue_code)
90
- end
91
-
92
- def eql?(o)
93
- self.class == o.class && @kind == o.kind && @issue_code == o.issue_code
94
- end
95
-
96
- def generalize
97
- DEFAULT
98
- end
99
-
100
- def hash
101
- self.class.hash ^ @kind.hash ^ @issue_code.hash
102
- end
103
-
104
- def instance?(o, guard = nil)
105
- if o.is_a?(Error)
106
- unless @kind.nil?
107
- return false unless @kind.instance?(o.kind)
108
- end
109
- unless @issue_code.nil?
110
- return false unless @issue_code.instance?(o.issue_code)
111
- end
112
- true
113
- else
114
- false
115
- end
116
- end
117
-
118
- def normalize(guard = nil)
119
- nk = @kind.nil? ? nil : @kind.normalize(guard)
120
- ni = @issue_code.nil? ? nil : @issue_code.normalize(guard)
121
- nk.equal?(@kind) && ni.equal?(@issue_code) ? self : new(nk, ni)
122
- end
123
-
124
- protected
125
-
126
- def _assignable?(o, guard = nil)
127
- if o.class == self.class
128
- unless @kind.nil?
129
- return false unless o.kind && @kind.assignable?(o.kind, guard)
130
- end
131
- unless @issue_code.nil?
132
- return false unless o.issue_code && @issue_code.assignable?(o.issue_code)
133
- end
134
- true
135
- else
136
- false
137
- end
138
- end
139
-
140
- private
141
-
142
- def convert_arg(arg)
143
- case arg
144
- when nil, :default
145
- nil
146
- when String
147
- PStringType.new(arg)
148
- when Regexp
149
- PPatternType.new([PRegexpType.new(arg)])
150
- else
151
- arg
152
- end
153
- end
154
-
155
- DEFAULT = PErrorType.new(nil, nil)
156
- end
157
- end
158
- end