Ensure all bin/ files are as "dumb" as possible.

This commit is contained in:
Kiall Mac Innes 2012-10-14 18:55:18 +01:00
parent 7c80526a6c
commit 69fca2f4a9
7 changed files with 18 additions and 14 deletions

View File

@ -32,7 +32,5 @@ cfg.CONF(sys.argv[1:], project='moniker', prog='moniker-agent-bind9',
logging.setup('moniker')
serv = bind9_service.Service(cfg.CONF.host, cfg.CONF.agent_topic)
launcher = service.launch(serv)
launcher = service.launch(bind9_service.Service())
launcher.wait()

View File

@ -32,7 +32,5 @@ cfg.CONF(sys.argv[1:], project='moniker', prog='moniker-api',
logging.setup('moniker')
serv = api_service.Service(host=cfg.CONF.api_host, port=cfg.CONF.api_port)
launcher = service.launch(serv)
launcher = service.launch(api_service.Service())
launcher.wait()

View File

@ -32,7 +32,5 @@ cfg.CONF(sys.argv[1:], project='moniker', prog='moniker-central',
logging.setup('moniker')
serv = central_service.Service(cfg.CONF.host, cfg.CONF.central_topic)
launcher = service.launch(serv)
launcher = service.launch(central_service.Service())
launcher.wait()

View File

@ -35,6 +35,11 @@ cfg.CONF.register_opts([
class Service(rpc_service.Service):
def __init__(self, *args, **kwargs):
kwargs.update(
host=cfg.CONF.host,
topic=cfg.CONF.agent_topic
)
super(Service, self).__init__(*args, **kwargs)
# TODO: This is a hack to ensure the data dir is 100% up to date

View File

@ -24,11 +24,11 @@ LOG = logging.getLogger(__name__)
class Service(wsgi.Service):
def __init__(self, port, host='0.0.0.0', backlog=128, threads=1000):
def __init__(self, backlog=128, threads=1000):
super(Service, self).__init__(threads)
self.host = host
self.port = port
self.host = cfg.CONF.api_host
self.port = cfg.CONF.api_port
self.backlog = backlog
config_path = cfg.CONF.api_paste_config

View File

@ -13,6 +13,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.openstack.common.rpc import service as rpc_service
from moniker import database
@ -24,8 +25,12 @@ LOG = logging.getLogger(__name__)
class Service(rpc_service.Service):
def __init__(self, *args, **kwargs):
kwargs.update(
host=cfg.CONF.host,
topic=cfg.CONF.central_topic
)
super(Service, self).__init__(*args, **kwargs)
self.init_database()

View File

@ -20,4 +20,4 @@ from moniker.tests import TestCase
class CentralTestCase(TestCase):
def get_central_service(self):
return central_service.Service(cfg.CONF.host, cfg.CONF.central_topic)
return central_service.Service()