summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpuppethost.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/puppethost.py b/puppethost.py
index 7b1a7f7..15f0478 100755
--- a/puppethost.py
+++ b/puppethost.py
@@ -5,6 +5,7 @@ import os
import glob
import time
import shutil
+import socket
import OpenSSL
import tarfile
import commands
@@ -27,10 +28,10 @@ defaults = {
}
del ssldir
-status, domain = commands.getstatusoutput('dnsdomainname')
-if status == 0:
- defaults['domain'] = domain
-del status
+try:
+ defaults['domain'] = socket.getfqdn().split('.', 1)[1]
+except:
+ pass
config = os.path.expanduser('~/.puppethost')
if os.path.exists(config):