From df9b3455414bc0370f94ee71ba2e3de1deef726d Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sat, 29 Aug 2015 13:20:17 -0700 Subject: [PATCH] Adding a better error message for really long common names Fixes #38 --- lemur/plugins/lemur_cloudca/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemur/plugins/lemur_cloudca/plugin.py b/lemur/plugins/lemur_cloudca/plugin.py index 2d26666a..14a4cb8f 100644 --- a/lemur/plugins/lemur_cloudca/plugin.py +++ b/lemur/plugins/lemur_cloudca/plugin.py @@ -7,6 +7,7 @@ .. moduleauthor:: Kevin Glisson """ +import re import ssl import base64 from json import dumps @@ -297,7 +298,7 @@ class CloudCAIssuerPlugin(IssuerPlugin, CloudCA): 'ownerEmail': options['owner'], 'caName': options['authority'].name, 'csr': csr, - 'comment': options['description'] + 'comment': re.sub(r'^[\w\-\s]+$', '', options['description']) } response = self.post(endpoint, remove_none(cloudca_options))