puppet 2.6.4 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +147 -0
- data/LICENSE +2 -2
- data/Rakefile +3 -4
- data/lib/puppet.rb +1 -1
- data/lib/puppet/application.rb +22 -5
- data/lib/puppet/application/apply.rb +2 -18
- data/lib/puppet/application/doc.rb +1 -4
- data/lib/puppet/application/inspect.rb +178 -0
- data/lib/puppet/configurer.rb +9 -11
- data/lib/puppet/configurer/plugin_handler.rb +0 -2
- data/lib/puppet/defaults.rb +12 -3
- data/lib/puppet/external/pson/pure/generator.rb +1 -22
- data/lib/puppet/file_bucket/dipper.rb +9 -3
- data/lib/puppet/file_bucket/file.rb +14 -94
- data/lib/puppet/indirector.rb +4 -0
- data/lib/puppet/indirector/catalog/active_record.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +64 -75
- data/lib/puppet/indirector/indirection.rb +18 -8
- data/lib/puppet/indirector/resource/ral.rb +7 -2
- data/lib/puppet/indirector/rest.rb +19 -2
- data/lib/puppet/network/http/api/v1.rb +3 -0
- data/lib/puppet/network/http/handler.rb +16 -1
- data/lib/puppet/network/http/rack/rest.rb +1 -3
- data/lib/puppet/network/rest_authconfig.rb +4 -12
- data/lib/puppet/network/rights.rb +28 -14
- data/lib/puppet/parser/ast.rb +4 -0
- data/lib/puppet/parser/compiler.rb +18 -3
- data/lib/puppet/parser/functions/defined.rb +28 -6
- data/lib/puppet/parser/functions/fqdn_rand.rb +6 -3
- data/lib/puppet/parser/templatewrapper.rb +1 -0
- data/lib/puppet/property.rb +16 -1
- data/lib/puppet/property/keyvalue.rb +0 -2
- data/lib/puppet/property/list.rb +0 -2
- data/lib/puppet/provider/file/posix.rb +1 -3
- data/lib/puppet/provider/file/win32.rb +1 -3
- data/lib/puppet/provider/maillist/mailman.rb +3 -5
- data/lib/puppet/provider/mount.rb +2 -0
- data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
- data/lib/puppet/provider/package/freebsd.rb +2 -2
- data/lib/puppet/provider/zone/solaris.rb +1 -1
- data/lib/puppet/reference/configuration.rb +2 -2
- data/lib/puppet/reference/function.rb +4 -0
- data/lib/puppet/relationship.rb +4 -0
- data/lib/puppet/reports/store.rb +1 -19
- data/lib/puppet/resource.rb +11 -2
- data/lib/puppet/resource/status.rb +24 -3
- data/lib/puppet/resource/type.rb +24 -16
- data/lib/puppet/resource/type_collection.rb +4 -1
- data/lib/puppet/simple_graph.rb +4 -0
- data/lib/puppet/transaction.rb +1 -28
- data/lib/puppet/transaction/event.rb +9 -4
- data/lib/puppet/transaction/report.rb +42 -22
- data/lib/puppet/transaction/resource_harness.rb +99 -71
- data/lib/puppet/type.rb +22 -9
- data/lib/puppet/type/cron.rb +1 -5
- data/lib/puppet/type/exec.rb +4 -34
- data/lib/puppet/type/file.rb +19 -26
- data/lib/puppet/type/file/checksum.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -1
- data/lib/puppet/type/file/ctime.rb +18 -0
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +10 -44
- data/lib/puppet/type/file/mtime.rb +17 -0
- data/lib/puppet/type/file/owner.rb +1 -1
- data/lib/puppet/type/file/source.rb +0 -1
- data/lib/puppet/type/file/target.rb +1 -1
- data/lib/puppet/type/file/type.rb +5 -12
- data/lib/puppet/type/host.rb +1 -1
- data/lib/puppet/type/mount.rb +2 -2
- data/lib/puppet/type/package.rb +0 -2
- data/lib/puppet/type/service.rb +11 -5
- data/lib/puppet/type/user.rb +7 -9
- data/lib/puppet/type/yumrepo.rb +2 -2
- data/lib/puppet/type/zpool.rb +0 -4
- data/lib/puppet/util/checksums.rb +24 -1
- data/lib/puppet/util/command_line.rb +6 -2
- data/lib/puppet/util/command_line/puppet +5 -1
- data/lib/puppet/util/command_line/puppetca +2 -2
- data/lib/puppet/util/command_line/puppetd +11 -9
- data/lib/puppet/util/command_line/puppetdoc +2 -2
- data/lib/puppet/util/command_line/puppetmasterd +5 -0
- data/lib/puppet/util/log.rb +15 -8
- data/lib/puppet/util/log/destinations.rb +2 -0
- data/lib/puppet/util/log_paths.rb +1 -1
- data/lib/puppet/util/logging.rb +1 -1
- data/lib/puppet/util/metric.rb +1 -0
- data/lib/puppet/util/reference.rb +1 -10
- data/lib/puppet/util/settings.rb +1 -1
- data/lib/puppet/util/zaml.rb +30 -31
- data/spec/fixtures/unit/provider/mount/mount-output.aix.txt +7 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/defaults_spec.rb +1 -0
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -4
- data/spec/integration/indirector/report/rest_spec.rb +13 -17
- data/spec/integration/network/formats_spec.rb +2 -5
- data/spec/integration/network/server/mongrel_spec.rb +1 -2
- data/spec/integration/provider/mailalias/aliases_spec.rb +0 -1
- data/spec/integration/provider/package_spec.rb +1 -3
- data/spec/integration/provider/service/init_spec.rb +3 -9
- data/spec/integration/reference/providers_spec.rb +2 -2
- data/spec/integration/resource/catalog_spec.rb +1 -2
- data/spec/integration/transaction/report_spec.rb +1 -1
- data/spec/monkey_patches/alias_should_to_must.rb +2 -0
- data/spec/shared_behaviours/file_server_terminus.rb +1 -1
- data/spec/shared_behaviours/file_serving.rb +1 -1
- data/spec/shared_behaviours/memory_terminus.rb +1 -1
- data/spec/spec_helper.rb +8 -6
- data/spec/unit/application/agent_spec.rb +1 -0
- data/spec/unit/application/apply_spec.rb +7 -7
- data/spec/unit/application/doc_spec.rb +2 -2
- data/spec/unit/application/filebucket_spec.rb +1 -0
- data/spec/unit/application/inspect_spec.rb +278 -0
- data/spec/unit/application/kick_spec.rb +1 -3
- data/spec/unit/application/master_spec.rb +1 -3
- data/spec/unit/application/queue_spec.rb +1 -0
- data/spec/unit/application_spec.rb +63 -5
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -1
- data/spec/unit/configurer_spec.rb +33 -49
- data/spec/unit/file_bucket/dipper_spec.rb +69 -77
- data/spec/unit/file_bucket/file_spec.rb +12 -127
- data/spec/unit/file_serving/fileset_spec.rb +1 -0
- data/spec/unit/file_serving/metadata_spec.rb +4 -4
- data/spec/unit/indirector/active_record_spec.rb +1 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +29 -13
- data/spec/unit/indirector/facts/active_record_spec.rb +2 -3
- data/spec/unit/indirector/facts/couch_spec.rb +1 -2
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +202 -218
- data/spec/unit/indirector/file_server_spec.rb +6 -7
- data/spec/unit/indirector/indirection_spec.rb +71 -2
- data/spec/unit/indirector/ldap_spec.rb +2 -6
- data/spec/unit/indirector/node/active_record_spec.rb +1 -3
- data/spec/unit/indirector/queue_spec.rb +1 -3
- data/spec/unit/indirector/rest_spec.rb +37 -1
- data/spec/unit/indirector/ssl_file_spec.rb +5 -5
- data/spec/unit/indirector_spec.rb +6 -1
- data/spec/unit/module_spec.rb +1 -3
- data/spec/unit/network/formats_spec.rb +2 -5
- data/spec/unit/network/http/api/v1_spec.rb +4 -0
- data/spec/unit/network/http/compression_spec.rb +1 -3
- data/spec/unit/network/http/handler_spec.rb +39 -0
- data/spec/unit/network/http/mongrel/rest_spec.rb +1 -2
- data/spec/unit/network/http/mongrel_spec.rb +3 -9
- data/spec/unit/network/http/rack/rest_spec.rb +1 -3
- data/spec/unit/network/http/rack/xmlrpc_spec.rb +2 -3
- data/spec/unit/network/http/rack_spec.rb +2 -3
- data/spec/unit/network/http/webrick_spec.rb +1 -0
- data/spec/unit/network/rest_authconfig_spec.rb +1 -1
- data/spec/unit/network/rights_spec.rb +43 -23
- data/spec/unit/network/xmlrpc/client_spec.rb +1 -0
- data/spec/unit/parameter_spec.rb +1 -2
- data/spec/unit/parser/collector_spec.rb +3 -6
- data/spec/unit/parser/compiler_spec.rb +90 -5
- data/spec/unit/parser/lexer_spec.rb +3 -2
- data/spec/unit/parser/templatewrapper_spec.rb +1 -0
- data/spec/unit/property/keyvalue_spec.rb +5 -5
- data/spec/unit/property/list_spec.rb +7 -7
- data/spec/unit/provider/mount/parsed_spec.rb +1 -2
- data/spec/unit/provider/mount_spec.rb +8 -0
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +38 -0
- data/spec/unit/provider/package/freebsd_spec.rb +55 -0
- data/spec/unit/provider/service/init_spec.rb +2 -0
- data/spec/unit/rails/host_spec.rb +1 -3
- data/spec/unit/rails/param_value_spec.rb +2 -3
- data/spec/unit/rails/resource_spec.rb +2 -3
- data/spec/unit/rails_spec.rb +5 -15
- data/spec/unit/relationship_spec.rb +2 -6
- data/spec/unit/reports/http_spec.rb +1 -1
- data/spec/unit/reports/store_spec.rb +31 -0
- data/spec/unit/reports/tagmail_spec.rb +1 -1
- data/spec/unit/resource/catalog_spec.rb +2 -6
- data/spec/unit/resource/status_spec.rb +53 -3
- data/spec/unit/resource/type_collection_spec.rb +0 -8
- data/spec/unit/resource/type_spec.rb +50 -4
- data/spec/unit/resource_spec.rb +10 -6
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +1 -1
- data/spec/unit/transaction/event_spec.rb +21 -2
- data/spec/unit/transaction/report_spec.rb +91 -35
- data/spec/unit/transaction/resource_harness_spec.rb +289 -208
- data/spec/unit/transaction_spec.rb +1 -6
- data/spec/unit/type/augeas_spec.rb +1 -3
- data/spec/unit/type/file/content_spec.rb +63 -10
- data/spec/unit/type/file/ctime.rb +35 -0
- data/spec/unit/type/file/ensure_spec.rb +8 -7
- data/spec/unit/type/file/group_spec.rb +5 -5
- data/spec/unit/type/file/mtime.rb +35 -0
- data/spec/unit/type/file/owner_spec.rb +7 -7
- data/spec/unit/type/file/selinux_spec.rb +2 -2
- data/spec/unit/type/file/source_spec.rb +3 -3
- data/spec/unit/type/file/type.rb +20 -0
- data/spec/unit/type/file_spec.rb +131 -8
- data/spec/unit/type/mount_spec.rb +4 -4
- data/spec/unit/type/package_spec.rb +3 -3
- data/spec/unit/type/ssh_authorized_key_spec.rb +1 -1
- data/spec/unit/type/user_spec.rb +31 -3
- data/spec/unit/type/zpool_spec.rb +12 -12
- data/spec/unit/type_spec.rb +2 -2
- data/spec/unit/util/checksums_spec.rb +9 -1
- data/spec/unit/util/command_line_spec.rb +29 -0
- data/spec/unit/util/log/destinations_spec.rb +13 -0
- data/spec/unit/util/log_spec.rb +24 -12
- data/spec/unit/util/logging_spec.rb +1 -1
- data/spec/unit/util/metric_spec.rb +7 -7
- data/spec/unit/util/pson_spec.rb +15 -0
- data/spec/unit/util/queue/stomp_spec.rb +2 -6
- data/spec/unit/util/settings/file_setting_spec.rb +1 -3
- data/spec/unit/util/zaml_spec.rb +51 -0
- data/test/language/snippets.rb +3 -0
- data/test/lib/puppettest/fileparsing.rb +2 -0
- data/test/lib/puppettest/reporttesting.rb +1 -1
- data/test/lib/puppettest/support/utils.rb +1 -1
- data/test/network/server/mongrel_test.rb +0 -6
- data/test/other/report.rb +1 -1
- data/test/ral/providers/cron/crontab.rb +4 -1
- data/test/ral/type/file.rb +1 -1
- data/test/ral/type/filesources.rb +1 -4
- metadata +1119 -1113
- data/lib/puppet/transaction/change.rb +0 -87
- data/spec/Rakefile +0 -91
- data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +0 -46
- data/spec/spec_specs/runnable_spec.rb +0 -95
- data/spec/unit/transaction/change_spec.rb +0 -193
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# puppet agent [-D|--daemonize|--no-daemonize] [-d|--debug]
|
13
13
|
# [--detailed-exitcodes] [--disable] [--enable]
|
14
|
-
# [-h|--help] [--
|
14
|
+
# [-h|--help] [--certname <host name>] [-l|--logdest syslog|<file>|console]
|
15
15
|
# [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
|
16
16
|
# [--digest <digest>] [--fingerprint] [-V|--version]
|
17
17
|
# [-v|--verbose] [-w|--waitforcert <seconds>]
|
@@ -60,7 +60,7 @@
|
|
60
60
|
# before signing a certificate request on the master, the certificate request the
|
61
61
|
# master received is the same as the one the client sent (to prevent against
|
62
62
|
# man-in-the-middle attacks when signing certificates).
|
63
|
-
#
|
63
|
+
#
|
64
64
|
#
|
65
65
|
# = Options
|
66
66
|
#
|
@@ -113,10 +113,11 @@
|
|
113
113
|
#
|
114
114
|
# +puppet agent+ exits after executing this.
|
115
115
|
#
|
116
|
-
#
|
117
|
-
# Set the
|
118
|
-
#
|
119
|
-
#
|
116
|
+
# certname::
|
117
|
+
# Set the certname (unique ID) of the client. The master reads this unique
|
118
|
+
# identifying string, which is usually set to the node's fully-qualified domain
|
119
|
+
# name, to determine which configurations the node will receive. Use this option
|
120
|
+
# to debug setup problems or implement unusual node identification schemes.
|
120
121
|
#
|
121
122
|
# help::
|
122
123
|
# Print this help message
|
@@ -132,8 +133,8 @@
|
|
132
133
|
# makes sense when used in conjunction with --listen.
|
133
134
|
#
|
134
135
|
# onetime::
|
135
|
-
# Run the configuration once. Runs a single (normally daemonized) Puppet run.
|
136
|
-
# Useful for interactively running puppet agent when used in conjunction with
|
136
|
+
# Run the configuration once. Runs a single (normally daemonized) Puppet run.
|
137
|
+
# Useful for interactively running puppet agent when used in conjunction with
|
137
138
|
# the --no-daemonize option.
|
138
139
|
#
|
139
140
|
# fingerprint::
|
@@ -150,7 +151,8 @@
|
|
150
151
|
#
|
151
152
|
# test::
|
152
153
|
# Enable the most common options used for testing. These are +onetime+,
|
153
|
-
# +verbose+, +ignorecache, +no-daemonize+,
|
154
|
+
# +verbose+, +ignorecache, +no-daemonize+, +no-usecacheonfailure+,
|
155
|
+
# +detailed-exit-codes+, +no-splay+, and +show_diff+.
|
154
156
|
#
|
155
157
|
# noop::
|
156
158
|
# Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful
|
@@ -37,7 +37,7 @@
|
|
37
37
|
# Specifies the directory where to output the rdoc documentation in 'rdoc' mode.
|
38
38
|
#
|
39
39
|
# mode::
|
40
|
-
# Determine the output mode. Valid modes are 'text', '
|
40
|
+
# Determine the output mode. Valid modes are 'text', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path'
|
41
41
|
#
|
42
42
|
# reference::
|
43
43
|
# Build a particular reference. Get a list of references by running +puppet doc --list+.
|
@@ -47,7 +47,7 @@
|
|
47
47
|
#
|
48
48
|
# = Example
|
49
49
|
#
|
50
|
-
# $ puppet doc -r type > /tmp/type_reference.
|
50
|
+
# $ puppet doc -r type > /tmp/type_reference.markdown
|
51
51
|
# or
|
52
52
|
# $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests
|
53
53
|
# or
|
@@ -9,6 +9,7 @@
|
|
9
9
|
#
|
10
10
|
# puppet master [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help]
|
11
11
|
# [-l|--logdest <file>|console|syslog] [-v|--verbose] [-V|--version]
|
12
|
+
# [--compile <nodename>]
|
12
13
|
#
|
13
14
|
# = Description
|
14
15
|
#
|
@@ -49,6 +50,10 @@
|
|
49
50
|
# version::
|
50
51
|
# Print the puppet version number and exit.
|
51
52
|
#
|
53
|
+
# compile::
|
54
|
+
# Capability to compile a catalogue and output it in JSON from the Puppet master. Uses
|
55
|
+
# facts contained in the $vardir/yaml/ directory to compile the catalog.
|
56
|
+
#
|
52
57
|
# = Example
|
53
58
|
#
|
54
59
|
# puppet master
|
data/lib/puppet/util/log.rb
CHANGED
@@ -17,11 +17,12 @@ class Puppet::Util::Log
|
|
17
17
|
# Create a new destination type.
|
18
18
|
def self.newdesttype(name, options = {}, &block)
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
:
|
23
|
-
:
|
24
|
-
|
20
|
+
dest = genclass(
|
21
|
+
name,
|
22
|
+
:parent => Puppet::Util::Log::Destination,
|
23
|
+
:prefix => "Dest",
|
24
|
+
:block => block,
|
25
|
+
:hash => @desttypes,
|
25
26
|
:attributes => options
|
26
27
|
)
|
27
28
|
dest.match(dest.name)
|
@@ -66,6 +67,12 @@ class Puppet::Util::Log
|
|
66
67
|
}
|
67
68
|
end
|
68
69
|
|
70
|
+
def Log.autoflush=(v)
|
71
|
+
@destinations.each do |type, dest|
|
72
|
+
dest.autoflush = v if dest.respond_to?(:autoflush=)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
69
76
|
# Create a new log message. The primary role of this method is to
|
70
77
|
# avoid creating log messages below the loglevel.
|
71
78
|
def Log.create(hash)
|
@@ -188,7 +195,7 @@ class Puppet::Util::Log
|
|
188
195
|
@levels.include?(level)
|
189
196
|
end
|
190
197
|
|
191
|
-
attr_accessor :time, :remote, :file, :line, :
|
198
|
+
attr_accessor :time, :remote, :file, :line, :source
|
192
199
|
attr_reader :level, :message
|
193
200
|
|
194
201
|
def initialize(args)
|
@@ -202,7 +209,7 @@ class Puppet::Util::Log
|
|
202
209
|
tags.each { |t| self.tag(t) }
|
203
210
|
end
|
204
211
|
|
205
|
-
[:file, :line
|
212
|
+
[:file, :line].each do |attr|
|
206
213
|
next unless value = args[attr]
|
207
214
|
send(attr.to_s + "=", value)
|
208
215
|
end
|
@@ -233,7 +240,7 @@ class Puppet::Util::Log
|
|
233
240
|
|
234
241
|
descriptors[:tags].each { |t| tag(t) }
|
235
242
|
|
236
|
-
[:file, :line
|
243
|
+
[:file, :line].each do |param|
|
237
244
|
next unless descriptors[param]
|
238
245
|
send(param.to_s + "=", descriptors[param])
|
239
246
|
end
|
data/lib/puppet/util/logging.rb
CHANGED
data/lib/puppet/util/metric.rb
CHANGED
@@ -120,16 +120,11 @@ class Puppet::Util::Reference
|
|
120
120
|
str += "\n\n"
|
121
121
|
end
|
122
122
|
|
123
|
-
# Remove all trac links.
|
124
|
-
def strip_trac(text)
|
125
|
-
text.gsub(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
|
126
|
-
end
|
127
|
-
|
128
123
|
def text
|
129
124
|
puts output
|
130
125
|
end
|
131
126
|
|
132
|
-
def
|
127
|
+
def to_markdown(withcontents = true)
|
133
128
|
# First the header
|
134
129
|
text = h(@title, 1)
|
135
130
|
text += "\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on #{Time.now.to_s})*\n\n"
|
@@ -142,8 +137,4 @@ class Puppet::Util::Reference
|
|
142
137
|
|
143
138
|
text
|
144
139
|
end
|
145
|
-
|
146
|
-
def to_text(withcontents = true)
|
147
|
-
strip_trac(to_rest(withcontents))
|
148
|
-
end
|
149
140
|
end
|
data/lib/puppet/util/settings.rb
CHANGED
@@ -593,7 +593,7 @@ if @config.include?(:run_mode)
|
|
593
593
|
end
|
594
594
|
eachsection do |section|
|
595
595
|
persection(section) do |obj|
|
596
|
-
str += obj.to_config + "\n" unless ReadOnly.include? obj.name
|
596
|
+
str += obj.to_config + "\n" unless ReadOnly.include? obj.name or obj.name == :genconfig
|
597
597
|
end
|
598
598
|
end
|
599
599
|
|
data/lib/puppet/util/zaml.rb
CHANGED
@@ -20,6 +20,7 @@ class ZAML
|
|
20
20
|
def self.dump(stuff, where='')
|
21
21
|
z = new
|
22
22
|
stuff.to_zaml(z)
|
23
|
+
Label.counter_reset
|
23
24
|
where << z.to_s
|
24
25
|
end
|
25
26
|
#
|
@@ -59,13 +60,13 @@ class ZAML
|
|
59
60
|
@@previously_emitted_object = {}
|
60
61
|
@@next_free_label_number = 0
|
61
62
|
end
|
62
|
-
def initialize(obj
|
63
|
-
@indent = indent
|
63
|
+
def initialize(obj)
|
64
64
|
@this_label_number = nil
|
65
|
+
@obj = obj # prevent garbage collection so that object id isn't reused
|
65
66
|
@@previously_emitted_object[obj.object_id] = self
|
66
67
|
end
|
67
68
|
def to_s
|
68
|
-
@this_label_number ? ('&id%03d
|
69
|
+
@this_label_number ? ('&id%03d ' % @this_label_number) : ''
|
69
70
|
end
|
70
71
|
def reference
|
71
72
|
@this_label_number ||= (@@next_free_label_number += 1)
|
@@ -76,7 +77,7 @@ class ZAML
|
|
76
77
|
end
|
77
78
|
end
|
78
79
|
def new_label_for(obj)
|
79
|
-
Label.new(obj
|
80
|
+
Label.new(obj)
|
80
81
|
end
|
81
82
|
def first_time_only(obj)
|
82
83
|
if label = Label.for(obj)
|
@@ -92,7 +93,7 @@ class ZAML
|
|
92
93
|
end
|
93
94
|
def emit(s)
|
94
95
|
@result << s
|
95
|
-
@recent_nl = false
|
96
|
+
@recent_nl = false
|
96
97
|
end
|
97
98
|
def nl(s='')
|
98
99
|
emit(@indent || "\n") unless @recent_nl
|
@@ -224,32 +225,30 @@ class String
|
|
224
225
|
gsub( /([\x80-\xFF])/ ) { |x| "\\x#{x.unpack("C")[0].to_s(16)}" }
|
225
226
|
end
|
226
227
|
def to_zaml(z)
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
end
|
252
|
-
}
|
228
|
+
num = '[-+]?(0x)?\d+\.?\d*'
|
229
|
+
case
|
230
|
+
when self == ''
|
231
|
+
z.emit('""')
|
232
|
+
# when self =~ /[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\xFF]/
|
233
|
+
# z.emit("!binary |\n")
|
234
|
+
# z.emit([self].pack("m*"))
|
235
|
+
when (
|
236
|
+
(self =~ /\A(true|false|yes|no|on|null|off|#{num}(:#{num})*|!|=|~)$/i) or
|
237
|
+
(self =~ /\A\n* /) or
|
238
|
+
(self =~ /[\s:]$/) or
|
239
|
+
(self =~ /^[>|][-+\d]*\s/i) or
|
240
|
+
(self[-1..-1] =~ /\s/) or
|
241
|
+
(self =~ /[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\xFF]/) or
|
242
|
+
(self =~ /[,\[\]\{\}\r\t]|:\s|\s#/) or
|
243
|
+
(self =~ /\A([-:?!#&*'"]|<<|%.+:.)/)
|
244
|
+
)
|
245
|
+
z.emit("\"#{escaped_for_zaml}\"")
|
246
|
+
when self =~ /\n/
|
247
|
+
if self[-1..-1] == "\n" then z.emit('|+') else z.emit('|-') end
|
248
|
+
z.nested { split("\n",-1).each { |line| z.nl; z.emit(line.chomp("\n")) } }
|
249
|
+
else
|
250
|
+
z.emit(self)
|
251
|
+
end
|
253
252
|
end
|
254
253
|
end
|
255
254
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
node mounted mounted over vfs date options
|
2
|
+
---- ------- ------------ --- ------------ -------------------
|
3
|
+
/dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8
|
4
|
+
/dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8
|
5
|
+
/dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8
|
6
|
+
/dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8
|
7
|
+
sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8
|
@@ -9,8 +9,7 @@ require 'puppet/application/apply'
|
|
9
9
|
describe "apply" do
|
10
10
|
include PuppetSpec::Files
|
11
11
|
|
12
|
-
describe "when applying provided catalogs" do
|
13
|
-
confine "PSON library is missing; cannot test applying catalogs" => Puppet.features.pson?
|
12
|
+
describe "when applying provided catalogs", :if => Puppet.features.pson? do
|
14
13
|
it "should be able to apply catalogs provided in a file in pson" do
|
15
14
|
file_to_create = tmpfile("pson_catalog")
|
16
15
|
catalog = Puppet::Resource::Catalog.new
|
@@ -4,10 +4,7 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
|
|
4
4
|
|
5
5
|
require 'puppet/resource/catalog'
|
6
6
|
|
7
|
-
|
8
|
-
describe "Puppet::Resource::Catalog::Queue" do
|
9
|
-
confine "Missing pson support; cannot test queue" => Puppet.features.pson?
|
10
|
-
|
7
|
+
describe "Puppet::Resource::Catalog::Queue", :if => Puppet.features.pson? do
|
11
8
|
before do
|
12
9
|
Puppet::Resource::Catalog.indirection.terminus(:queue)
|
13
10
|
@catalog = Puppet::Resource::Catalog.new
|
@@ -64,33 +64,29 @@ describe "Report REST Terminus" do
|
|
64
64
|
it "should be able to send a report to the server" do
|
65
65
|
@report.expects(:save)
|
66
66
|
|
67
|
-
report = Puppet::Transaction::Report.new
|
67
|
+
report = Puppet::Transaction::Report.new("apply")
|
68
68
|
|
69
69
|
resourcemetrics = {
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
70
|
+
"total" => 12,
|
71
|
+
"out_of_sync" => 20,
|
72
|
+
"applied" => 45,
|
73
|
+
"skipped" => 1,
|
74
|
+
"restarted" => 23,
|
75
|
+
"failed_restarts" => 1,
|
76
|
+
"scheduled" => 10
|
77
77
|
}
|
78
78
|
report.add_metric(:resources, resourcemetrics)
|
79
79
|
|
80
80
|
timemetrics = {
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
"resource1" => 10,
|
82
|
+
"resource2" => 50,
|
83
|
+
"resource3" => 40,
|
84
|
+
"resource4" => 20,
|
85
85
|
}
|
86
86
|
report.add_metric(:times, timemetrics)
|
87
87
|
|
88
88
|
|
89
|
-
|
90
|
-
:changes,
|
91
|
-
|
92
|
-
:total => 20
|
93
|
-
)
|
89
|
+
report.add_metric(:changes, "total" => 20)
|
94
90
|
|
95
91
|
report.save
|
96
92
|
end
|
@@ -46,8 +46,7 @@ describe Puppet::Network::FormatHandler.format(:s) do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
describe Puppet::Network::FormatHandler.format(:pson) do
|
49
|
-
describe "when pson is absent" do
|
50
|
-
confine "'pson' library is present" => (! Puppet.features.pson?)
|
49
|
+
describe "when pson is absent", :if => (! Puppet.features.pson?) do
|
51
50
|
|
52
51
|
before do
|
53
52
|
@pson = Puppet::Network::FormatHandler.format(:pson)
|
@@ -58,9 +57,7 @@ describe Puppet::Network::FormatHandler.format(:pson) do
|
|
58
57
|
end
|
59
58
|
end
|
60
59
|
|
61
|
-
describe "when pson is available" do
|
62
|
-
confine "Missing 'pson' library" => Puppet.features.pson?
|
63
|
-
|
60
|
+
describe "when pson is available", :if => Puppet.features.pson? do
|
64
61
|
before do
|
65
62
|
@pson = Puppet::Network::FormatHandler.format(:pson)
|
66
63
|
end
|
@@ -5,8 +5,7 @@ require 'puppet/network/server'
|
|
5
5
|
require 'socket'
|
6
6
|
|
7
7
|
describe Puppet::Network::Server do
|
8
|
-
describe "when using mongrel" do
|
9
|
-
confine "Mongrel is not available" => Puppet.features.mongrel?
|
8
|
+
describe "when using mongrel", :if => Puppet.features.mongrel? do
|
10
9
|
|
11
10
|
before :each do
|
12
11
|
Puppet[:servertype] = 'mongrel'
|