summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2008-11-28 00:05:17 -0500
committerTodd Zullinger <tmz@pobox.com>2008-11-28 00:05:36 -0500
commit09464391c18647ce94f1285b667e8c0e7c913083 (patch)
tree51e4a6ba3d9a371b9b5c13bb08e5b6649970da45
parent8a668566959c420647f08cb1277c2c220f96031f (diff)
downloadpuppet-host-package-09464391c18647ce94f1285b667e8c0e7c913083.tar.gz
puppet-host-package-09464391c18647ce94f1285b667e8c0e7c913083.tar.xz
puppet-host-package-09464391c18647ce94f1285b667e8c0e7c913083.zip
Make pyOpenSSL optionalv0.4.0
-rw-r--r--puppethost.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/puppethost.py b/puppethost.py
index 312eb38..ef09c3c 100644
--- a/puppethost.py
+++ b/puppethost.py
@@ -20,10 +20,8 @@ version = '.'.join(map(str, version_info))
import os
import sys
-import time
import shutil
import socket
-import OpenSSL
import tarfile
import commands
import tempfile
@@ -242,11 +240,13 @@ class PuppetHost(object):
cert = self.files['cert']
try:
- x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
- open(cert).read())
+ import OpenSSL.crypto as crypto
+ x509 = crypto.load_certificate(crypto.FILETYPE_PEM,
+ open(cert).read())
self._version = x509.get_notBefore()[:8]
except:
# pyOpenSSL < 0.7 lacks load_certificate()... do it the hard way
+ import time
format = '%Y%m%d'
cmd = 'openssl x509 -in %s -text -noout' % cert
status, output = commands.getstatusoutput(cmd)