Example #1
0
    def setup_rpc(self, conf, rpc_backends=None, mq_type=None):
        # How is your message queue setup?
        if not mq_type:
            raw_mq_type = self.installer.get_option('mq-type')
            if raw_mq_type:
                mq_type = utils.canon_mq_type(raw_mq_type)
        if not mq_type:
            msg = ("%s requires a message queue to operate. "
                   "Please specify a 'mq-type' in configuration."
                   % self.installer.name.title())
            raise exceptions.ConfigException(msg)

        if rpc_backends is not None:
            try:
                conf.add('rpc_backend', rpc_backends[mq_type])
            except KeyError:
                msg = ("%s does not support mq type %s."
                       % (self.installer.name.title(), mq_type))
                raise exceptions.ConfigException(msg)

        if mq_type == 'rabbit':
            conf.add('rabbit_host',
                     self.installer.get_option('rabbit', 'host',
                                               default_value=self.installer.get_option('ip')))
            conf.add('rabbit_password', self.installer.get_password('rabbit'))
            conf.add('rabbit_userid', self.installer.get_option('rabbit', 'user_id'))
        elif mq_type == 'qpid':
            conf.add('qpid_hostname',
                     self.installer.get_option('qpid', 'host',
                                               default_value=self.installer.get_option('ip')))
            conf.add('qpid_password', self.installer.get_password('qpid'))
            conf.add('qpid_username', self.installer.get_option('qpid', 'user_id'))
Example #2
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option("mq-type"))
     if mq_type == "rabbit":
         conf.add(
             "rabbit_host",
             self.installer.get_option("rabbit", "host", default_value=self.installer.get_option("ip")),
         )
         conf.add("rabbit_password", rhelper.get_shared_passwords(self.installer)["pw"])
         conf.add("rabbit_userid", self.installer.get_option("rabbit", "user_id"))
         if rpc_backend:
             conf.add("rpc_backend", rpc_backend)
Example #3
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option('mq-type'))
     if mq_type == 'rabbit':
         conf.add(
             'rabbit_host',
             self.installer.get_option(
                 'rabbit', 'host',
                 default_value=self.installer.get_option('ip')))
         conf.add('rabbit_password',
                  rhelper.get_shared_passwords(self.installer)['pw'])
         conf.add('rabbit_userid',
                  self.installer.get_option('rabbit', 'user_id'))
         if rpc_backend:
             conf.add('rpc_backend', rpc_backend)
Example #4
0
 def setup_rpc(self, conf, rpc_backend=None):
     # How is your message queue setup?
     mq_type = utils.canon_mq_type(self.installer.get_option('mq-type'))
     if mq_type == 'rabbit':
         conf.add(
             'rabbit_host',
             self.installer.get_option(
                 'rabbit',
                 'host',
                 default_value=self.installer.get_option('ip')))
         conf.add('rabbit_password',
                  rhelper.get_shared_passwords(self.installer)['pw'])
         conf.add('rabbit_userid',
                  self.installer.get_option('rabbit', 'user_id'))
         if rpc_backend:
             conf.add('rpc_backend', rpc_backend)
Example #5
0
    def setup_rpc(self, conf, rpc_backends=None, mq_type=None):
        # How is your message queue setup?
        if not mq_type:
            raw_mq_type = self.installer.get_option('mq-type')
            if raw_mq_type:
                mq_type = utils.canon_mq_type(raw_mq_type)
        if not mq_type:
            msg = ("%s requires a message queue to operate. "
                   "Please specify a 'mq-type' in configuration." %
                   self.installer.name.title())
            raise exceptions.ConfigException(msg)

        if rpc_backends is not None:
            try:
                conf.add('rpc_backend', rpc_backends[mq_type])
            except KeyError:
                msg = ("%s does not support mq type %s." %
                       (self.installer.name.title(), mq_type))
                raise exceptions.ConfigException(msg)

        if mq_type == 'rabbit':
            conf.add(
                'rabbit_host',
                self.installer.get_option(
                    'rabbit',
                    'host',
                    default_value=self.installer.get_option('ip')))
            conf.add('rabbit_password', self.installer.get_password('rabbit'))
            conf.add('rabbit_userid',
                     self.installer.get_option('rabbit', 'user_id'))
        elif mq_type == 'qpid':
            conf.add(
                'qpid_hostname',
                self.installer.get_option(
                    'qpid',
                    'host',
                    default_value=self.installer.get_option('ip')))
            conf.add('qpid_password', self.installer.get_password('qpid'))
            conf.add('qpid_username',
                     self.installer.get_option('qpid', 'user_id'))
Example #6
0
 def warm_configs(self):
     mq_type = utils.canon_mq_type(self.get_option('mq-type'))
     if mq_type == 'rabbit':
         rhelper.get_shared_passwords(self)
Example #7
0
 def warm_configs(self):
     mq_type = utils.canon_mq_type(self.get_option('mq-type'))
     if mq_type == 'rabbit':
         rhelper.get_shared_passwords(self)