diff options
author | Stuart Mackie <wsmackie@juniper.net> | 2017-03-23 06:26:16 -0700 |
---|---|---|
committer | Stuart Mackie <wsmackie@juniper.net> | 2017-03-23 06:26:16 -0700 |
commit | c29a525331b45ead15ec376d03f76836d622c943 (patch) | |
tree | 6713f16cb30c739a66a0cb56fb4e2efed732eff1 /Testcases/cfgm_common/ifmap/response.py | |
parent | 88df88a19674ccc0017836941b8ee32eaadf19fb (diff) |
Removed test case files without correct license language. Will replace in future.
Change-Id: I16435a250257cf97a67a8ba31303c89d74204ac2
Signed-off-by: Stuart Mackie <wsmackie@juniper.net>
Diffstat (limited to 'Testcases/cfgm_common/ifmap/response.py')
-rw-r--r-- | Testcases/cfgm_common/ifmap/response.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Testcases/cfgm_common/ifmap/response.py b/Testcases/cfgm_common/ifmap/response.py deleted file mode 100644 index 179fd01..0000000 --- a/Testcases/cfgm_common/ifmap/response.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2011, Infoblox, All Rights Reserved -# -# Open Source, see LICENSE -# - -from xml.etree import ElementTree - -class Response(): - """ - Base class to handle and parse IF-MAP responses - """ - __xml = "" - - def __init__(self, result): - """ - Take a result string and process it - """ - if result: - env = ElementTree.fromstring(result) - body = env.find('{http://www.w3.org/2003/05/soap-envelope}Body') - response = body.find('{http://www.trustedcomputinggroup.org/2010/IFMAP/2}response') - # xml.etree.ElementTree find is broken in python 2.6 - children = response.findall('*') - if len(children): - self.__xml = children[0] - - def element(self): - """ - Returns the raw Element object - """ - return self.__xml - - def __str__(self): - """ - Print the XML tree as a string - """ - return ElementTree.tostring(self.__xml) - -class newSessionResult(Response): - """ - newSessionResult - """ - def __init__(self, result): - #import pdb; pdb.set_trace() - self.__newSession = Response(result).element() - - def get_session_id(self): - return self.__newSession.attrib['session-id'] - - def get_publisher_id(self): - return self.__newSession.attrib['ifmap-publisher-id'] - - - - |