Fixing a few issues with startup. (#374)

This commit is contained in:
kevgliss 2016-06-28 14:28:05 -07:00 committed by GitHub
parent 5021e8ba91
commit c8447dea3d
2 changed files with 9 additions and 11 deletions

View File

@ -10,15 +10,13 @@
.. moduleauthor:: Mikhail Khodorovskiy <mikhail.khodorovskiy@jivesoftware.com> .. moduleauthor:: Mikhail Khodorovskiy <mikhail.khodorovskiy@jivesoftware.com>
""" """
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from lemur.certificates.models import get_cn
from lemur.plugins.bases import DestinationPlugin
import itertools
import base64 import base64
import requests
import urllib import urllib
import requests
import itertools
from lemur.certificates.models import Certificate
from lemur.plugins.bases import DestinationPlugin
DEFAULT_API_VERSION = 'v1' DEFAULT_API_VERSION = 'v1'
@ -109,11 +107,10 @@ class KubernetesDestinationPlugin(DestinationPlugin):
k8s_api = K8sSession(k8_bearer, k8_cert) k8s_api = K8sSession(k8_bearer, k8_cert)
cert = x509.load_pem_x509_certificate(str(body), default_backend()) cert = Certificate(body=body)
name = get_cn(cert)
# in the future once runtime properties can be passed-in - use passed-in secret name # in the future once runtime properties can be passed-in - use passed-in secret name
secret_name = 'certs-' + urllib.quote_plus(name) secret_name = 'certs-' + urllib.quote_plus(cert.name)
err = ensure_resource(k8s_api, k8s_base_uri=k8_base_uri, namespace=k8_namespace, kind="secret", name=secret_name, data={ err = ensure_resource(k8s_api, k8s_base_uri=k8_base_uri, namespace=k8_namespace, kind="secret", name=secret_name, data={
'apiVersion': 'v1', 'apiVersion': 'v1',

View File

@ -60,7 +60,8 @@ install_requires = [
'inflection==0.3.1', 'inflection==0.3.1',
'future==0.15.2', 'future==0.15.2',
'boto==2.38.0', # we might make this optional 'boto==2.38.0', # we might make this optional
'boto3==1.3.0' 'boto3==1.3.0',
'acme==0.1.0'
] ]
tests_require = [ tests_require = [