Merge "Decouple Image Import Plugin Opts"
This commit is contained in:
commit
4c221c7cc7
34
glance/async/flows/plugins/plugin_opts.py
Normal file
34
glance/async/flows/plugins/plugin_opts.py
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# Copyright 2018 Red Hat, Inc.
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# 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 glance.async.flows.plugins.inject_image_metadata
|
||||||
|
|
||||||
|
|
||||||
|
# Note(jokke): This list contains tuples of config options for import plugins.
|
||||||
|
# When new plugin is introduced its config options need to be added to this
|
||||||
|
# list so that they can be processed, when config generator is used to generate
|
||||||
|
# the glance-image-import.conf.sample it will also pick up the details. The
|
||||||
|
# module needs to be imported as the Glance release packaged example(s) above
|
||||||
|
# and the first part of the tuple refers to the group the options gets
|
||||||
|
# registered under at the config file.
|
||||||
|
PLUGIN_OPTS = [
|
||||||
|
('inject_metadata_properties',
|
||||||
|
glance.async.flows.plugins.inject_image_metadata.inject_metadata_opts),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def get_plugin_opts():
|
||||||
|
return PLUGIN_OPTS
|
@ -30,7 +30,7 @@ import glance.api.middleware.context
|
|||||||
import glance.api.versions
|
import glance.api.versions
|
||||||
import glance.async.flows.api_image_import
|
import glance.async.flows.api_image_import
|
||||||
import glance.async.flows.convert
|
import glance.async.flows.convert
|
||||||
import glance.async.flows.plugins.inject_image_metadata
|
from glance.async.flows.plugins import plugin_opts
|
||||||
import glance.async.taskflow_executor
|
import glance.async.taskflow_executor
|
||||||
import glance.common.config
|
import glance.common.config
|
||||||
import glance.common.location_strategy
|
import glance.common.location_strategy
|
||||||
@ -109,8 +109,6 @@ _manage_opts = [
|
|||||||
]
|
]
|
||||||
_image_import_opts = [
|
_image_import_opts = [
|
||||||
('image_import_opts', glance.async.flows.api_image_import.api_import_opts),
|
('image_import_opts', glance.async.flows.api_image_import.api_import_opts),
|
||||||
('inject_metadata_properties',
|
|
||||||
glance.async.flows.plugins.inject_image_metadata.inject_metadata_opts)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -162,4 +160,6 @@ def list_manage_opts():
|
|||||||
|
|
||||||
def list_image_import_opts():
|
def list_image_import_opts():
|
||||||
"""Return a list of oslo_config options available for Image Import"""
|
"""Return a list of oslo_config options available for Image Import"""
|
||||||
return [(g, copy.deepcopy(o)) for g, o in _image_import_opts]
|
|
||||||
|
opts = _image_import_opts.extend(plugin_opts.get_plugin_opts())
|
||||||
|
return [(g, copy.deepcopy(o)) for g, o in opts]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user