summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--puppethost.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/puppethost.py b/puppethost.py
index 6a08ae3..a4b6106 100644
--- a/puppethost.py
+++ b/puppethost.py
@@ -47,23 +47,24 @@ try:
except:
pass
-config = os.path.expanduser('~/.puppethost')
-if os.path.exists(config):
- execfile(config, {}, defaults)
- truths = ['true', 'yes', '1']
- # Ensure boolean options are set correctly
- for opt in ['force', 'force_cert', 'force_tarball', 'force_package']:
- defaults[opt] = str(defaults[opt]).lower() in truths
- # Ensure numeric options are set correctly
- for opt in ['verbose']:
- if isinstance(defaults[opt], bool):
- defaults[opt] = int(defaults[opt])
- elif not isinstance(defaults[opt], int):
- try:
- defaults[opt] = int(str(defaults[opt]).lower() in truths)
- except:
- raise
- defaults[opt] = 0
+configs = ['/etc/puppet/hostpackage.conf', os.path.expanduser('~/.puppethost')]
+for config in configs:
+ if os.path.exists(config):
+ execfile(config, {}, defaults)
+ truths = ['true', 'yes', '1']
+ # Ensure boolean options are set correctly
+ for opt in ['force', 'force_cert', 'force_tarball', 'force_package']:
+ defaults[opt] = str(defaults[opt]).lower() in truths
+ # Ensure numeric options are set correctly
+ for opt in ['verbose']:
+ if isinstance(defaults[opt], bool):
+ defaults[opt] = int(defaults[opt])
+ elif not isinstance(defaults[opt], int):
+ try:
+ defaults[opt] = int(str(defaults[opt]).lower() in truths)
+ except:
+ raise
+ defaults[opt] = 0
package_types = ['deb', 'rpm']