def _connect(self): if self.connected: return if not self.api_url: raise FafConfigError( "No api_url specified for '{0}' bugzilla instance" .format(self.name)) self.log_debug("Opening bugzilla connection for '{0}'" .format(self.name)) self.bz = bugzilla.Bugzilla(url=str(self.api_url), cookiefile=None, tokenfile=None) if self.user and self.password: self.log_debug("Logging into bugzilla '{0}' as '{1}'" .format(self.name, self.user)) self.bz.login(self.user, self.password) else: self.log_warn("No user and password specified for '{0}' bugzilla" "instance, using anonymously") self.connected = True
def connect(self): if self.connected: return if not self.api_url: raise FafConfigError( "No api_url specified for '{0}' mantisbt instance".format( self.name)) if not self.user or not self.password: raise FafConfigError("No username or password specified for '{0}'" " mantisbt instance".format(self.name)) self.log_debug("Opening mantisbt connection for '%s'", self.name) client = Client(self.api_url) self.mantis_client = client self.mc = client.service self.connected = True