def wrapper(self, *args, **kwargs): if isinstance(self.client, SessionClient): msg = ('This call is no longer available. The operation should ' 'be performed on the session object instead.') raise exceptions.InvalidUsage(msg) return f(self, *args, **kwargs)
def __enter__(self): raise exceptions.InvalidUsage( _("NovaClient instance can't be used as a context manager " "since it is redundant in case of SessionClient."))