def stop_Context_broker(context): """ stop ContextBroker :param context: It’s a clever place where you and behave can store information to share around. It runs at three levels, automatically managed by behave. """ if context.configuration["CB_RUNNING_MODE"].upper() == "RPM": __logger__.debug("Stopping contextBroker service...") context.my_fab.run("service contextBroker stop") __logger__.info("...Stopped contextBroker service") else: __logger__.debug("Stopping contextBroker per harakiri...") cb = CB(protocol=props_cb["CB_PROTOCOL"], host=props_cb["CB_HOST"], port=props_cb["CB_PORT"]) cb.harakiri() __logger__.info("...Stopped contextBroker per harakiri")