Skip to content

Commit

Permalink
Merge pull request #745 from deric/unwrap
Browse files Browse the repository at this point in the history
Remove redundant function icinga2::unwrap
  • Loading branch information
lbetz authored Dec 22, 2023
2 parents de7bd64 + 0c7347c commit 0a4450e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 39 deletions.
19 changes: 0 additions & 19 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ with or without TLS information.
For more information, see lib/puppet_x/icinga2/utils.rb.
* [`icinga2::icinga2_ticket_id`](#icinga2--icinga2_ticket_id): Summarise what the function does here
* [`icinga2::parse`](#icinga2--parse)
* [`icinga2::unwrap`](#icinga2--unwrap): This function returns an unwrap string if necessary.

### Data types

Expand Down Expand Up @@ -5734,24 +5733,6 @@ Data type: `Hash[String, Any]`



### <a name="icinga2--unwrap"></a>`icinga2::unwrap`

Type: Puppet Language

This function returns an unwrap string if necessary.

#### `icinga2::unwrap(Optional[Variant[String, Sensitive[String]]] $arg = undef)`

The icinga2::unwrap function.

Returns: `Any` The unwraped string.

##### `arg`

Data type: `Optional[Variant[String, Sensitive[String]]]`



## Data types

### <a name="Icinga2--BasicAuth"></a>`Icinga2::BasicAuth`
Expand Down
2 changes: 1 addition & 1 deletion functions/db/connect.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function icinga2::db::connect(
'dbname=' => $db['database'],
})), ' '), '= ', '=', 'G')
} else {
$_password = icinga2::unwrap($db['password'])
$_password = unwrap($db['password'])
$options = join(any2array(delete_undef_values({
'-h' => $db['host'] ? {
/localhost/ => undef,
Expand Down
16 changes: 0 additions & 16 deletions functions/unwrap.pp

This file was deleted.

2 changes: 1 addition & 1 deletion manifests/feature/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
file { "${data_dir}/icingadb.env":
ensure => file,
mode => '0600',
content => sprintf('"%s"', icinga2::unwrap($env_id)),
content => sprintf('"%s"', unwrap($env_id)),
show_diff => false,
tag => 'icinga2::config::file',
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
exec { 'idopgsql-import-schema':
user => 'root',
path => $facts['path'],
environment => [sprintf('PGPASSWORD=%s', icinga2::unwrap($password))],
environment => [sprintf('PGPASSWORD=%s', unwrap($password))],
command => "psql '${db_cli_options}' -w -f '${ido_pgsql_schema}'",
unless => "psql '${db_cli_options}' -w -c 'select version from icinga_dbversion'",
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/tls/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$key_mode = '0400'
}

if icinga2::unwrap($args[key]) {
if unwrap($args[key]) {
file { $args['key_file']:
ensure => file,
content => icinga::newline(icinga2::unwrap($args['key'])),
Expand Down

0 comments on commit 0a4450e

Please sign in to comment.