From 135499f120f8e4b538381c56732486815fa3904c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 19 Jun 2013 11:19:45 +0200 Subject: [PATCH 1/2] __process: make --state optional Signed-off-by: Nico Schottelius --- cdist/conf/type/__process/gencode-remote | 7 ++++++- cdist/conf/type/__process/man.text | 5 +---- cdist/conf/type/__process/parameter/optional | 1 + cdist/conf/type/__process/parameter/required | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 cdist/conf/type/__process/parameter/required diff --git a/cdist/conf/type/__process/gencode-remote b/cdist/conf/type/__process/gencode-remote index fdb6033a..f178f706 100755 --- a/cdist/conf/type/__process/gencode-remote +++ b/cdist/conf/type/__process/gencode-remote @@ -25,7 +25,12 @@ else name="$__object_id" fi -state_should="$(cat "$__object/parameter/state")" +parameter_state="$__object/parameter/state" +if [ -f "$_parameter_state" ]; then + state_should=(cat "$__object/parameter/state") +else + state_should="present" +fi runs="$(cat "$__object/explorer/runs")" if [ "$runs" ]; then diff --git a/cdist/conf/type/__process/man.text b/cdist/conf/type/__process/man.text index 0d457ead..2fdd27aa 100644 --- a/cdist/conf/type/__process/man.text +++ b/cdist/conf/type/__process/man.text @@ -13,14 +13,11 @@ DESCRIPTION This cdist type allows you to define the state of a process. -REQUIRED PARAMETERS +OPTIONAL PARAMETERS ------------------- state:: Either "present" or "absent", defaults to "present" - -OPTIONAL PARAMETERS -------------------- name:: Process name to match on when using pgrep -f -x. diff --git a/cdist/conf/type/__process/parameter/optional b/cdist/conf/type/__process/parameter/optional index 3411afb4..85fe8805 100644 --- a/cdist/conf/type/__process/parameter/optional +++ b/cdist/conf/type/__process/parameter/optional @@ -1,3 +1,4 @@ name stop start +state diff --git a/cdist/conf/type/__process/parameter/required b/cdist/conf/type/__process/parameter/required deleted file mode 100644 index ff72b5c7..00000000 --- a/cdist/conf/type/__process/parameter/required +++ /dev/null @@ -1 +0,0 @@ -state From a1b946abc44d6914f8ad45a2a1eaacac75b94d12 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 19 Jun 2013 11:20:18 +0200 Subject: [PATCH 2/2] ++changes Signed-off-by: Nico Schottelius --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index b97d3ace..3f9defee 100644 --- a/docs/changelog +++ b/docs/changelog @@ -14,6 +14,7 @@ next: * Type __git: Missing quotes added (Chase James) * Type __postgres_database: Make state parameter optional (Chase James) * Type __postgres_role: Make state parameter optional, fix password bug (Chase James) + * Type __process: Make state parameter optional 2.1.1: 2013-04-08 * Core: Use dynamic dependency resolver to allow indirect self dependencies