You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: REFERENCE.md
+53-3Lines changed: 53 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,9 @@ Thus making it directly usable with the values from facter.
28
28
*[`extlib::path_join`](#extlib--path_join): Take one or more paths and join them together
29
29
*[`extlib::random_password`](#extlib--random_password): A function to return a string of arbitrary length that contains randomly selected characters.
30
30
*[`extlib::read_url`](#extlib--read_url): Fetch a string from a URL (should only be used with 'small' remote files). This function should only be used with trusted/internal sources.
31
-
*[`extlib::remote_pql_query`](#extlib--remote_pql_query): Perform a PuppetDB query on an arbitrary PuppetDB server If you need to query a PuppetDB server that is not connected to your Puppet Server
31
+
*[`extlib::remote_pql_query`](#extlib--remote_pql_query): Perform a PuppetDB query on an arbitrary PuppetDB server.
32
32
*[`extlib::remove_blank_lines`](#extlib--remove_blank_lines): Remove blank lines from a string
33
+
*[`extlib::remove_resource`](#extlib--remove_resource): Removes a Resource or an Array of Resources from the catalog.
33
34
*[`extlib::resources_deep_merge`](#extlib--resources_deep_merge): Deeply merge a "defaults" hash into a "resources" hash like the ones expected by `create_resources()`.
34
35
*[`extlib::sort_by_version`](#extlib--sort_by_version): A function that sorts an array of version numbers.
35
36
*[`extlib::to_ini`](#extlib--to_ini): This converts a puppet hash to an INI string.
@@ -964,8 +965,6 @@ The URL to read from
964
965
965
966
Type: Ruby 4.x API
966
967
967
-
Perform a PuppetDB query on an arbitrary PuppetDB server
968
-
969
968
If you need to query a PuppetDB server that is not connected to your Puppet
970
969
Server (perhaps part of a separate Puppet installation that uses its own
# To remove the resource, we reverse the actions from compiler.add_resource
47
+
# See https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/compiler.rb#L77-L80
48
+
scope.catalog.remove_resource(catalog_resource)
49
+
scope.compiler.resources.delete(catalog_resource)
50
+
else
51
+
msg="`remove_resource` couldn't remove resource #{resource.type_name}['#{resource.title}'] from the catalog as it wasn't found when `remove_resource` was called."
it{is_expected.torun.with_params(user_foo).and_raise_error(Puppet::ParseError,%r{`remove_resource` couldn't remove resource User\['foo'\] from the catalog})}
13
+
14
+
context'when soft_fail is true'do
15
+
it{is_expected.torun.with_params(user_foo,true)}
16
+
17
+
it'logs a warning'do
18
+
msg="`remove_resource` couldn't remove resource User['foo'] from the catalog as it wasn't found when `remove_resource` was called."
0 commit comments