Puppet Function: wildfly::patch_args

Defined in:
functions/patch_args.pp
Function type:
Puppet Language

Overview

wildfly::patch_args(Stdlib::Unixpath $source, Boolean $override_all, Array $override, Array $preserve)String

Generate args for JBoss-CLI ‘patch` command.

Parameters:

  • source (Stdlib::Unixpath)

    path to patch file.

  • override_all (Boolean)

    Whether it should solve all conflicts by overriding current files.

  • override (Array)

    List of files to be overridden.

  • preserve (Array)

    List of files to be preserved.

Returns:

  • (String)

    args for patch command.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'functions/patch_args.pp', line 8

function wildfly::patch_args(
  Stdlib::Unixpath $source,
  Boolean $override_all,
  Array $override,
  Array $preserve,
) {
  $override_param = join($override, ',')
  $preserve_param = join($preserve, ',')

  case [$override_all, empty($override), empty($preserve)] {
    [true, default, default]: { "${source} --override-all" }
    [false, false, false]:    { "${source} --override=${override_param} --preserve=${preserve_param}" }
    [false, false, true]:     { "${source} --override=${override_param}" }
    [false, true, false]:     { "${source} --preserve=${preserve_param}" }
    [false, true, true]:      { $source }
  }
}