Esempio n. 1
0
 def parse_response(self):
     """Locate and parse the response aggregate(s)"""
     super(QBMSRequest, self).parse_response()
     self.parse_signon_response()
     self.rs_aggregate_el = self.response_tree.find('.//%s' % self.rs_aggregate_type.__name__)
     self.response = self.rs_aggregate_type(element = self.rs_aggregate_el)
     if self.response.status_code != STATUS_SUCCESS:
         if self.response.status_severity == SEVERITY_ERROR:
             log.error(self.response.status_message)
             raise QBMSErrorType.from_rs(self.response)
         elif self.response.status_severity == SEVERITY_WARNING:
             log.warning(self.response.status_message)
     return self.response
Esempio n. 2
0
 def parse_signon_response(self):
     """Locate and parse the signon response aggregate"""
     for aggregate_type in self.signon_rs_aggregate_types:
         self.signon_rs_aggregate_el = self.response_tree.find('.//%s' % aggregate_type.__name__)
         if self.signon_rs_aggregate_el is not None:
             self.signon_response = aggregate_type(element = self.signon_rs_aggregate_el)
             if self.signon_response.status_code != STATUS_SUCCESS:
                 if self.signon_response.status_severity == SEVERITY_ERROR:
                     raise QBMSErrorType.from_rs(self.signon_response)
                 elif self.signon_response.status_severity == SEVERITY_WARNING:
                     log.warning(self.signon_response.status_message)
             break
     return self.signon_response