def on_init(self): bus.on("host_init_response", self.on_host_init_response) bus.on("before_host_up", self.on_before_host_up) bus.on("before_hello", self.on_before_hello) if bus.event_defined('rebundle_cleanup_image'): bus.on("rebundle_cleanup_image", self.cleanup_hosts_file) bus.on("before_host_down", self.on_before_host_down) if 'bootstrapping' == __node__['state']: self.cleanup_hosts_file('/') self._logger.info('Performing initial cluster reset') if os.path.exists(DEFAULT_STORAGE_PATH): rabbitmq_user = pwd.getpwnam("rabbitmq") os.chown(DEFAULT_STORAGE_PATH, rabbitmq_user.pw_uid, rabbitmq_user.pw_gid) self.service.start() self.rabbitmq.stop_app() self.rabbitmq.reset() self.service.stop() elif 'running' == __node__['state']: rabbitmq_vol = __rabbitmq__['volume'] if not __rabbitmq__['volume'].mounted_to(): self.service.stop() rabbitmq_vol.ensure() self.service.start() __rabbitmq__['volume'] = rabbitmq_vol
def on_init(self): bus.on("host_init_response", self.on_host_init_response) bus.on("before_host_up", self.on_before_host_up) bus.on("before_hello", self.on_before_hello) bus.on("start", self.on_start) if bus.event_defined('rebundle_cleanup_image'): bus.on("rebundle_cleanup_image", self.cleanup_hosts_file) bus.on("before_host_down", self.on_before_host_down)
def on_init(self): bus.on("host_init_response", self.on_host_init_response) bus.on("before_host_up", self.on_before_host_up) bus.on("before_hello", self.on_before_hello) bus.on("start", self.on_start) if bus.event_defined('rebundle_cleanup_image'): bus.on("rebundle_cleanup_image", self.cleanup_hosts_file) bus.on("before_host_down", self.on_before_host_down) if os_mod.redhat_family: self._patch_selinux()
def on_init(self): bus.on("host_init_response", self.on_host_init_response) bus.on("before_host_up", self.on_before_host_up) bus.on("before_hello", self.on_before_hello) bus.on("start", self.on_start) if bus.event_defined('rebundle_cleanup_image'): bus.on("rebundle_cleanup_image", self.cleanup_hosts_file) bus.on("before_host_down", self.on_before_host_down) if os_mod.redhat_family: try: self._patch_selinux() except: e = sys.exc_info()[1] self._logger.warning('Setting selinux boolean for rabbitmq-server failed: {0}'.format(e))