Adding a better error message for really long common names Fixes #38

This commit is contained in:
kevgliss 2015-08-29 13:20:17 -07:00
parent aca69ce03c
commit 62950128a2
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com> .. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
""" """
import re
import ssl import ssl
import base64 import base64
from json import dumps from json import dumps
@ -297,7 +298,7 @@ class CloudCAIssuerPlugin(IssuerPlugin, CloudCA):
'ownerEmail': options['owner'], 'ownerEmail': options['owner'],
'caName': options['authority'].name, 'caName': options['authority'].name,
'csr': csr, 'csr': csr,
'comment': options['description'] 'comment': re.sub(r'^[\w\-\s]+$', '', options['description'])
} }
response = self.post(endpoint, remove_none(cloudca_options)) response = self.post(endpoint, remove_none(cloudca_options))