From 661a8bf831cecd826aad4792a3a0ebd2bf667187 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Thu, 18 Oct 2012 18:31:41 +0200
Subject: [PATCH 1/6] problems with conflicting types - for documentation

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 .../logs/2012-10-17.conflicting-types-problem | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 doc/dev/logs/2012-10-17.conflicting-types-problem

diff --git a/doc/dev/logs/2012-10-17.conflicting-types-problem b/doc/dev/logs/2012-10-17.conflicting-types-problem
new file mode 100644
index 00000000..a976a7f7
--- /dev/null
+++ b/doc/dev/logs/2012-10-17.conflicting-types-problem
@@ -0,0 +1,19 @@
+Seen error:
+
+INFO: dns-vm-inx01: Generating and executing code for __package/bind-chroot
+INFO: dns-vm-inx01: Generating and executing code for __directory/var/named
+INFO: dns-vm-snr01: Running manifest and explorers for __directory/opt/local.ch/sys/icinga/conf.d
+INFO: dns-vm-inx02: Running manifest and explorers for __directory/opt/local.ch/sys
+mkdir: cannot create directory `/var/named': File exists
+ERROR: Command failed: ssh -o User=root -q dns-vm-inx01 umask 077; /bin/sh -e /var/lib/cdist/object/__directory/var/named/.cdist/code-remote
+INFO: dns-vm-snr01: Running manifest and explorers for __directory/opt/local.ch/web
+INFO: dns-vm-inx02: Running manifest and explorers for __directory/opt/local.ch/sys/bin
+INFO: dns-vm-snr02: Running manifest and explorers for __directory/opt/local.ch/web
+
+
+Problem source:
+
+__directory/var/named explorer detects that the directory is missing
+__package/named gencode-remote installs package, which creates directory
+__directory/var/named gencode-remote outputs mkdir
+

From 9228168bc907a2530bcc340ccc2dfbce33f81121 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Thu, 18 Oct 2012 18:34:30 +0200
Subject: [PATCH 2/6] update comment

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 doc/dev/logs/2012-10-17.conflicting-types-problem | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/dev/logs/2012-10-17.conflicting-types-problem b/doc/dev/logs/2012-10-17.conflicting-types-problem
index a976a7f7..5f35ddf7 100644
--- a/doc/dev/logs/2012-10-17.conflicting-types-problem
+++ b/doc/dev/logs/2012-10-17.conflicting-types-problem
@@ -17,3 +17,11 @@ __directory/var/named explorer detects that the directory is missing
 __package/named gencode-remote installs package, which creates directory
 __directory/var/named gencode-remote outputs mkdir
 
+Solutions:
+
+    - don't use __directory, because __package does already the job (clean solution)
+    - re-run explorer before gencode-* stage
+        - gencode-remote would have caught that
+
+Not sure yet - although the latter feature has been requested, the first
+solution looks better (more clean) to this problem.

From b7a8a84bfcf25e0d3a994b8e4f17e2740441658d Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Wed, 24 Oct 2012 10:21:38 +0200
Subject: [PATCH 3/6] do nothing by default and prevent traceback

If not given the function, we get:

aceback (most recent call last):
  File "/home/users/nico/p/cdist/core/bin/cdist", line 243, in <module>
    commandline()
  File "/home/users/nico/p/cdist/core/bin/cdist", line 107, in commandline
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 bin/cdist | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/cdist b/bin/cdist
index 75047acb..6b10bd32 100755
--- a/bin/cdist
+++ b/bin/cdist
@@ -39,12 +39,15 @@ def commandline():
         help='Set log level to info, be more verbose',
         action='store_true', default=False)
 
-    # Main subcommand parser
+    # Main parser
     parser['main'] = argparse.ArgumentParser(description='cdist ' + cdist.VERSION,
         parents=[parser['loglevel']])
     parser['main'].add_argument('-V', '--version',
         help='Show version', action='version',
         version='%(prog)s ' + cdist.VERSION)
+    #parser['main'].set_defaults(func=commandline_main)
+
+    # Subcommand shell
     parser['sub'] = parser['main'].add_subparsers(title="Commands")
 
     # Banner
@@ -103,6 +106,9 @@ def commandline():
     log.debug(args)
     args.func(args)
 
+def commandline_main(args):
+    pass
+
 def config(args):
     configinstall(args, mode=cdist.config.Config)
 

From 840dbc5fc2a7f363dd99e121fcd425daebeb92ee Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Wed, 24 Oct 2012 10:22:13 +0200
Subject: [PATCH 4/6] enable what I've committed just before

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
---
 bin/cdist | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/cdist b/bin/cdist
index 6b10bd32..8002119f 100755
--- a/bin/cdist
+++ b/bin/cdist
@@ -45,7 +45,7 @@ def commandline():
     parser['main'].add_argument('-V', '--version',
         help='Show version', action='version',
         version='%(prog)s ' + cdist.VERSION)
-    #parser['main'].set_defaults(func=commandline_main)
+    parser['main'].set_defaults(func=commandline_main)
 
     # Subcommand shell
     parser['sub'] = parser['main'].add_subparsers(title="Commands")

From 8a8192d3d375f0813028156fc46d34f197c31fd4 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Wed, 24 Oct 2012 11:16:29 +0200
Subject: [PATCH 5/6] Revert "enable what I've committed just before"

This reverts commit 840dbc5fc2a7f363dd99e121fcd425daebeb92ee.
---
 bin/cdist | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/cdist b/bin/cdist
index 8002119f..6b10bd32 100755
--- a/bin/cdist
+++ b/bin/cdist
@@ -45,7 +45,7 @@ def commandline():
     parser['main'].add_argument('-V', '--version',
         help='Show version', action='version',
         version='%(prog)s ' + cdist.VERSION)
-    parser['main'].set_defaults(func=commandline_main)
+    #parser['main'].set_defaults(func=commandline_main)
 
     # Subcommand shell
     parser['sub'] = parser['main'].add_subparsers(title="Commands")

From 5315c41903e61ed0013464e201abc33f38b90e2d Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@brief.schottelius.org>
Date: Wed, 24 Oct 2012 11:16:36 +0200
Subject: [PATCH 6/6] Revert "do nothing by default and prevent traceback"

This reverts commit b7a8a84bfcf25e0d3a994b8e4f17e2740441658d.
---
 bin/cdist | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/bin/cdist b/bin/cdist
index 6b10bd32..75047acb 100755
--- a/bin/cdist
+++ b/bin/cdist
@@ -39,15 +39,12 @@ def commandline():
         help='Set log level to info, be more verbose',
         action='store_true', default=False)
 
-    # Main parser
+    # Main subcommand parser
     parser['main'] = argparse.ArgumentParser(description='cdist ' + cdist.VERSION,
         parents=[parser['loglevel']])
     parser['main'].add_argument('-V', '--version',
         help='Show version', action='version',
         version='%(prog)s ' + cdist.VERSION)
-    #parser['main'].set_defaults(func=commandline_main)
-
-    # Subcommand shell
     parser['sub'] = parser['main'].add_subparsers(title="Commands")
 
     # Banner
@@ -106,9 +103,6 @@ def commandline():
     log.debug(args)
     args.func(args)
 
-def commandline_main(args):
-    pass
-
 def config(args):
     configinstall(args, mode=cdist.config.Config)