Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Catch and warn when config files are unreadable.

  • Loading branch information...
commit eb68f797990d616101597d1589d25d8b962d4329 1 parent 0609600
Ralph Bean authored August 30, 2012

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  fedmsg/config.py
8  fedmsg/config.py
@@ -37,6 +37,7 @@
37 37
 import os
38 38
 import sys
39 39
 import textwrap
  40
+import warnings
40 41
 
41 42
 from fedmsg.encoding import pretty_dumps
42 43
 
@@ -219,7 +220,10 @@ def _process_config_file(filenames=None):
219 220
     for fname in filenames:
220 221
         if os.path.isfile(fname):
221 222
             variables = {}
222  
-            execfile(fname, variables)
223  
-            config.update(variables['config'])
  223
+            try:
  224
+                execfile(fname, variables)
  225
+                config.update(variables['config'])
  226
+            except IOError as e:
  227
+                warnings.warn(str(e))
224 228
 
225 229
     return config

0 notes on commit eb68f79

Please sign in to comment.
Something went wrong with that request. Please try again.