From 22b99fb05d405c893ae75d28a7b4ee1c948a9c63 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 7 Apr 2021 17:44:16 +0300 Subject: [PATCH] Add taskmanager_manager option to common Option `taskmanager_manager` does not have defaults and thus is required to be set, otherwise trove-taskmanager will fail to start with AttributeError. In the meanwhile this is not clear what value is expected as option is not described anywhere. This change moves option to the general list, which will make it documented along with setting reasonable default. Change-Id: I546ffe88b6e135c3f4c6f71b5aef03b92011bed8 --- trove/cmd/taskmanager.py | 8 ++------ trove/common/cfg.py | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/trove/cmd/taskmanager.py b/trove/cmd/taskmanager.py index 9e181a0c78..b44d887569 100644 --- a/trove/cmd/taskmanager.py +++ b/trove/cmd/taskmanager.py @@ -12,15 +12,11 @@ # 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 oslo_config import cfg as openstack_cfg from oslo_service import service as openstack_service from trove.cmd.common import with_initialize -extra_opts = [openstack_cfg.StrOpt('taskmanager_manager')] - - def startup(conf, topic): from trove.common import notification from trove.common.rpc import service as rpc_service @@ -43,11 +39,11 @@ def startup(conf, topic): launcher.wait() -@with_initialize(extra_opts=extra_opts) +@with_initialize def main(conf): startup(conf, conf.taskmanager_queue) -@with_initialize(extra_opts=extra_opts) +@with_initialize def mgmt_main(conf): startup(conf, "mgmt-taskmanager") diff --git a/trove/common/cfg.py b/trove/common/cfg.py index e3f66f309a..e4c918021f 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -112,6 +112,9 @@ common_opts = [ help='Service type to use when searching catalog.'), cfg.StrOpt('glance_endpoint_type', default='publicURL', help='Service endpoint type to use when searching catalog.'), + cfg.StrOpt('taskmanager_manager', + default='trove.taskmanager.manager.Manager', + help='Driver for taskmanager'), cfg.StrOpt('trove_url', help='URL without the tenant segment.'), cfg.StrOpt('trove_service_type', default='database', help='Service type to use when searching catalog.'),