def wrapper(service, *args, **kwargs): if service.description is None: raise exceptions.NotRetrievedError( 'No service description retrieved for this service.') elif service.description == exceptions.NotAvailableError: return return func(service, *args, **kwargs)
def wrapper(instance, *args, **kwargs): if instance.base_url is None: raise exceptions.NotRetrievedError( 'No base URL was retrieved for this device.') return func(instance, *args, **kwargs)
def wrapper(device, *args, **kwargs): if device.description is None: raise exceptions.NotRetrievedError( 'No device description retrieved for this device.') return func(device, *args, **kwargs)