From f769b395c27a8eaf5ebdda518d2c9a201d9a5d46 Mon Sep 17 00:00:00 2001
From: Steven Armstrong <steven@icarus.ethz.ch>
Date: Wed, 7 Nov 2012 16:28:21 +0100
Subject: [PATCH] __file: implement --state exists

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
---
 cdist/conf/type/__file/gencode-local  | 2 +-
 cdist/conf/type/__file/gencode-remote | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cdist/conf/type/__file/gencode-local b/cdist/conf/type/__file/gencode-local
index b74893fb..a6c55abf 100755
--- a/cdist/conf/type/__file/gencode-local
+++ b/cdist/conf/type/__file/gencode-local
@@ -27,7 +27,7 @@ exists="$(cat "$__object/explorer/exists")"
 
 [ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do
 
-if [ "$state_should" = "present" ]; then
+if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then
    if [ -f "$__object/parameter/source" ]; then
       source="$(cat "$__object/parameter/source")"
       if [ "$source" = "-" ]; then
diff --git a/cdist/conf/type/__file/gencode-remote b/cdist/conf/type/__file/gencode-remote
index 2b4c7e45..04a1ea78 100755
--- a/cdist/conf/type/__file/gencode-remote
+++ b/cdist/conf/type/__file/gencode-remote
@@ -26,7 +26,7 @@ state_should="$(cat "$__object/parameter/state")"
 exists="$(cat "$__object/explorer/exists")"
 
 case "$state_should" in
-   present)
+   present|exists)
       # No source? Create empty file
       if [ ! -f "$__object/parameter/source" ]; then
          if [ "$exists" = "no" ]; then