From 9d00ecc4005ce029525512ab4cdcfe1e26065bfa Mon Sep 17 00:00:00 2001 From: Ade Lee Date: Sat, 4 May 2013 02:47:49 -0400 Subject: Fix tests in pkispawn to use legacy URLs as fallback When setting up clones or non-CA subsystems, pkispawn checks if the security domain is accessible and if the user can log in. These calls invoke REST URIs, which are not available on older subsystems. To support these subsystems, we need to attempt the older legacy servlets if the REST APIs are not available. Ticket #604 --- base/common/python/pki/system.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'base/common/python/pki') diff --git a/base/common/python/pki/system.py b/base/common/python/pki/system.py index 3c54e0015..5b4caf7f3 100644 --- a/base/common/python/pki/system.py +++ b/base/common/python/pki/system.py @@ -20,6 +20,7 @@ # import pki.encoder as encoder +import xml.etree.ElementTree as ET class SecurityDomainInfo: @@ -40,6 +41,15 @@ class SecurityDomainClient: return info + def getOldSecurityDomainInfo(self): + r = self.connection.get('/admin/ca/getDomainXML') + root = ET.fromstring(r.text) + domaininfo = ET.fromstring(root.find("DomainInfo").text) + info = SecurityDomainInfo() + info.name = domaininfo.find("Name").text + + return info + class ConfigurationRequest: def __init__(self): -- cgit