def _convert_property(self, name, value, child): """ Converts input pareametrs to RequestProperty """ if not isinstance(name, basestring): name = str(name) if not isinstance(value, basestring): value = str(self._convert_nested_to_str(value)) name = recoder.u2c(name) value = recoder.u2c(value) prop = self.corba_module.RequestProperty(name, value, False, child) return prop
def start_session(self, user_id, username): """Starts a new logging session. Arguments: userid: Int. Registrar id for EPP session or user id for other apps. username: String. Registrar Handle for EPP session or username for other apps. """ if not isinstance(username, basestring): username = str(username) else: username = recoder.u2c(username) logging.debug("<Logger %s> createSession %s %s" % (id(self), user_id, username)) session_id = self.dao.createSession(user_id, username) if session_id == 0: raise LoggingException( """Logging session failed to start with args: (%s).""" % username) return session_id