Move config options from nova/compute/rpcapi.py file
This patch moves the config options from nova/compute/rpcapi.py directory into the nova/conf/compute.py file. The help text will be improved in a subsequent patch. Blueprint centralize-config-options-newton Change-Id: Iac10f214919738730593e2a303f4236a7a7813c4
This commit is contained in:
@@ -16,18 +16,16 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
||||||
from nova.api.openstack import extensions
|
from nova.api.openstack import extensions
|
||||||
from nova.api.openstack import wsgi
|
from nova.api.openstack import wsgi
|
||||||
from nova import compute
|
from nova import compute
|
||||||
|
import nova.conf
|
||||||
from nova.i18n import _
|
from nova.i18n import _
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
|
|
||||||
|
|
||||||
ALIAS = 'os-instance-usage-audit-log'
|
ALIAS = 'os-instance-usage-audit-log'
|
||||||
authorize = extensions.os_compute_authorizer(ALIAS)
|
authorize = extensions.os_compute_authorizer(ALIAS)
|
||||||
|
@@ -16,18 +16,16 @@
|
|||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
||||||
from nova.api.openstack import extensions
|
from nova.api.openstack import extensions
|
||||||
from nova import compute
|
from nova import compute
|
||||||
|
import nova.conf
|
||||||
from nova import context as nova_context
|
from nova import context as nova_context
|
||||||
from nova.i18n import _
|
from nova.i18n import _
|
||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
|
|
||||||
|
|
||||||
authorize = extensions.extension_authorizer('compute',
|
authorize = extensions.extension_authorizer('compute',
|
||||||
'instance_usage_audit_log')
|
'instance_usage_audit_log')
|
||||||
|
@@ -35,7 +35,6 @@ from nova import utils
|
|||||||
from nova import version
|
from nova import version
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
LOG = logging.getLogger('nova.compute')
|
LOG = logging.getLogger('nova.compute')
|
||||||
|
|
||||||
|
|
||||||
|
@@ -89,7 +89,6 @@ wrap_exception = functools.partial(exception.wrap_exception,
|
|||||||
get_notifier=get_notifier)
|
get_notifier=get_notifier)
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
|
|
||||||
MAX_USERDATA_SIZE = 65535
|
MAX_USERDATA_SIZE = 65535
|
||||||
RO_SECURITY_GROUPS = ['default']
|
RO_SECURITY_GROUPS = ['default']
|
||||||
|
@@ -10,19 +10,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import itertools
|
|
||||||
|
|
||||||
import nova.compute.flavors
|
import nova.compute.flavors
|
||||||
import nova.compute.monitors
|
import nova.compute.monitors
|
||||||
import nova.compute.rpcapi
|
|
||||||
import nova.conf
|
import nova.conf
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return [
|
return [
|
||||||
('DEFAULT',
|
('DEFAULT',
|
||||||
itertools.chain(
|
|
||||||
nova.compute.flavors.flavor_opts,
|
nova.compute.flavors.flavor_opts,
|
||||||
nova.compute.rpcapi.rpcapi_opts,
|
),
|
||||||
)),
|
|
||||||
]
|
]
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
Client side of the compute RPC API.
|
Client side of the compute RPC API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
@@ -30,14 +29,7 @@ from nova.objects import migrate_data as migrate_data_obj
|
|||||||
from nova.objects import service as service_obj
|
from nova.objects import service as service_obj
|
||||||
from nova import rpc
|
from nova import rpc
|
||||||
|
|
||||||
rpcapi_opts = [
|
|
||||||
cfg.StrOpt('compute_topic',
|
|
||||||
default='compute',
|
|
||||||
help='The topic compute nodes listen on'),
|
|
||||||
]
|
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.register_opts(rpcapi_opts)
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
LAST_VERSION = None
|
LAST_VERSION = None
|
||||||
|
@@ -286,6 +286,12 @@ instance_cleaning_opts = [
|
|||||||
'files.'),
|
'files.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
rpcapi_opts = [
|
||||||
|
cfg.StrOpt('compute_topic',
|
||||||
|
default='compute',
|
||||||
|
help='The topic compute nodes listen on'),
|
||||||
|
]
|
||||||
|
|
||||||
ALL_OPTS = list(itertools.chain(
|
ALL_OPTS = list(itertools.chain(
|
||||||
compute_opts,
|
compute_opts,
|
||||||
resource_tracker_opts,
|
resource_tracker_opts,
|
||||||
@@ -294,7 +300,9 @@ ALL_OPTS = list(itertools.chain(
|
|||||||
interval_opts,
|
interval_opts,
|
||||||
timeout_opts,
|
timeout_opts,
|
||||||
running_deleted_opts,
|
running_deleted_opts,
|
||||||
instance_cleaning_opts))
|
instance_cleaning_opts,
|
||||||
|
rpcapi_opts,
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
@@ -21,14 +21,12 @@ Chance (Random) Scheduler implementation
|
|||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from oslo_config import cfg
|
import nova.conf
|
||||||
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova.i18n import _
|
from nova.i18n import _
|
||||||
from nova.scheduler import driver
|
from nova.scheduler import driver
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
|
|
||||||
|
|
||||||
class ChanceScheduler(driver.Scheduler):
|
class ChanceScheduler(driver.Scheduler):
|
||||||
|
@@ -34,8 +34,6 @@ from nova.tests.unit import fake_server_actions
|
|||||||
from nova.tests.unit.objects import test_flavor
|
from nova.tests.unit.objects import test_flavor
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
|
|
||||||
|
|
||||||
|
|
||||||
FAKE_COMPUTE_NODES = [dict(id=1, host='host1'), dict(id=2, host='host2')]
|
FAKE_COMPUTE_NODES = [dict(id=1, host='host1'), dict(id=2, host='host2')]
|
||||||
FAKE_SERVICES = [dict(id=1, host='host1'),
|
FAKE_SERVICES = [dict(id=1, host='host1'),
|
||||||
|
@@ -17,10 +17,10 @@ Unit Tests for nova.compute.rpcapi
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
|
||||||
from nova.compute import rpcapi as compute_rpcapi
|
from nova.compute import rpcapi as compute_rpcapi
|
||||||
|
import nova.conf
|
||||||
from nova import context
|
from nova import context
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova.objects import block_device as objects_block_dev
|
from nova.objects import block_device as objects_block_dev
|
||||||
@@ -30,7 +30,7 @@ from nova.tests.unit import fake_block_device
|
|||||||
from nova.tests.unit import fake_flavor
|
from nova.tests.unit import fake_flavor
|
||||||
from nova.tests.unit import fake_instance
|
from nova.tests.unit import fake_instance
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = nova.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class ComputeRpcAPITestCase(test.NoDBTestCase):
|
class ComputeRpcAPITestCase(test.NoDBTestCase):
|
||||||
|
@@ -18,13 +18,12 @@
|
|||||||
Test the base rpc API.
|
Test the base rpc API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from nova import baserpc
|
from nova import baserpc
|
||||||
|
import nova.conf
|
||||||
from nova import context
|
from nova import context
|
||||||
from nova import test
|
from nova import test
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = nova.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class BaseAPITestCase(test.TestCase):
|
class BaseAPITestCase(test.TestCase):
|
||||||
|
Reference in New Issue
Block a user