arv_db_node.py.patch
node.py 2019-07-18 14:57:58.014620617 +0200 | ||
---|---|---|
1 | 1 |
# coding: utf-8 |
2 |
import re |
|
2 | 3 |
from IPy import IP |
3 | 4 |
from os import unlink |
4 | 5 |
from elixir import * |
... | ... | |
272 | 273 |
name = unicode(cred_subject[1], 'utf-8') |
273 | 274 |
suffix_cred = cred_subject[0] |
274 | 275 |
suffix_cred = valid(suffix_cred, 'string') |
275 |
cred_subject = bin_encoding("%s/CN=%s"%(suffix_cred, name)) |
|
276 |
dn=re.sub(' = ', '=', re.sub(', ','/',"/%s/CN=%s"%(suffix_cred, name))) |
|
277 |
cred_subject = bin_encoding(dn) |
|
276 | 278 |
ca = Credential.query.filter_by(subject=cred_subject).first() |
277 | 279 |
if ca == None: |
278 |
raise Exception("CA does not exists in database, Can't add certificate")
|
|
280 |
raise Exception("CA [%s] does not exists in database, Can't add certificate"%(dn))
|
|
279 | 281 |
except Exception, e: |
280 | 282 |
raise ValueError(str(e)) |
281 | 283 |
else: |