summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)