def _get_notifier():
 global _notifier
 if (_notifier is None):
  host = (CONF.default_publisher_id or socket.gethostname())
  try:
   transport = oslo_messaging.get_notification_transport(CONF)
   _notifier = oslo_messaging.Notifier(transport, ('identity.%s' % host))
  except Exception:
   LOG.exception(_LE('Failed to construct notifier'))
   _notifier = False
 return _notifier

def _get_notifier ( ) : global _notifier if ( _notifier is None ) : host = ( CONF . default_publisher_id or socket . gethostname ( ) ) try : transport = oslo_messaging . get_notification_transport ( CONF ) _notifier = oslo_messaging . Notifier ( transport , ( 'identity.%s' % host ) ) except Exception : LOG . exception ( _LE ( 'Failed to construct notifier' ) ) _notifier = False return _notifier
check the context for the notifier and construct it if not present .