From cfa6aff01a35d40da3a20e4f06084d4b6d971190 Mon Sep 17 00:00:00 2001 From: Endre Karlson Date: Mon, 24 Jun 2013 16:18:57 +0200 Subject: [PATCH] Add launch to Biller Change-Id: I7fd589ed4fa91d781c0544ef9f45dab6f847c74a --- billingstack/biller/service.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/billingstack/biller/service.py b/billingstack/biller/service.py index 5c54c22..cac82be 100644 --- a/billingstack/biller/service.py +++ b/billingstack/biller/service.py @@ -13,10 +13,14 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +import sys + from oslo.config import cfg from billingstack.openstack.common import log as logging +from billingstack.openstack.common import service as os_service from billingstack.openstack.common.rpc import service as rpc_service from billingstack.storage.utils import get_connection +from billingstack import service as bs_service cfg.CONF.import_opt('biller_topic', 'billingstack.biller.rpcapi') @@ -88,3 +92,10 @@ class Service(rpc_service.Service): def delete_invoice_line(self, ctxt, id_): return self.storage_conn.delete_invoice_line(ctxt, id_) + + +def launch(): + bs_service.prepare_service(sys.argv) + launcher = os_service.launch(Service(), + cfg.CONF['service:biller'].workers) + launcher.wait()