config: Skip action configs starting with a dot.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 13:12:06 +0000 (15:12 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 10 Jun 2010 13:12:06 +0000 (15:12 +0200)
This prevents hidden files (like vim swapfiles) from being treated as a
config file.

src/lib/backupninja/config.py

index 0246efe11e34adc02104f5d8f67de6be4ff44a39..df38122b5169b2a43aead47f60034721bd11f63b 100644 (file)
@@ -58,7 +58,7 @@ def list_actions(opts):
     opts are the parsed commandline options.
     """
     actions_dir = os.path.join(opts.config_dir, opts.actions_dir)
-    return os.listdir(actions_dir)
+    return [f for f in os.listdir(actions_dir) if not f.startswith('.')]
     
 def _load_config(filename):
     # Open a file and read it