def _post_init(self): if self.service is None and self.SERVICE_CLASS is not None: self.service = self.SERVICE_CLASS(self.config, loglevel=self.log.level) if self.auth is None and self.AUTH_CLASS is not None: # pylint: disable=not-callable self.auth = self.AUTH_CLASS(self.config, loglevel=self.log.level) # pylint: enable=not-callable BaseCommand._post_init(self)
def _post_init(self): if self.service is None and self.SERVICE_CLASS is not None: self.service = self.SERVICE_CLASS(self.config, loglevel=self.log.level) if self.auth is None: if self.AUTH_CLASS is not None: self.auth = self.AUTH_CLASS(self.config, loglevel=self.log.level) elif self.SERVICE_CLASS.AUTH_CLASS is not None: # Backward compatibility msg = ('BaseService.AUTH_CLASS is deprecated; use ' 'BaseRequest.AUTH_CLASS instead') self.log.warn(msg) warnings.warn(msg, DeprecationWarning) self.auth = self.SERVICE_CLASS.AUTH_CLASS( self.config, loglevel=self.log.level) BaseCommand._post_init(self)