Rename nimble to mogan(part three)

This part includes codes folder renaming.

Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>

Change-Id: I919f17a769baee44ce19f65bab900f9d6bd8b982
This commit is contained in:
sxmatch 2016-12-30 11:33:01 +08:00 committed by Zhenguo Niu
parent 7555c2ae5b
commit 4fd1aab5b3
165 changed files with 490 additions and 488 deletions

View File

@ -1,4 +1,4 @@
To generate the sample nimble.conf file, run the following
command from the top level of the nimble directory:
To generate the sample mogan.conf file, run the following
command from the top level of the mogan directory:
tox -egenconfig

View File

@ -17,14 +17,14 @@
# Default API access rule
"default": "rule:admin_or_owner"
# Retrieve Instance records
"nimble:instance:get": "rule:default"
"mogan:instance:get": "rule:default"
# View Instance power and provision state
"nimble:instance:get_states": "rule:default"
"mogan:instance:get_states": "rule:default"
# Create Instance records
"nimble:instance:create": "rule:allow"
"mogan:instance:create": "rule:allow"
# Delete Instance records
"nimble:instance:delete": "rule:default"
"mogan:instance:delete": "rule:default"
# Update Instance records
"nimble:instance:update": "rule:default"
"mogan:instance:update": "rule:default"
# Change Instance power status
"nimble:instance:set_power_state": "rule:default"
"mogan:instance:set_power_state": "rule:default"

View File

@ -16,10 +16,10 @@
from oslo_config import cfg
import pecan
from nimble.api import config
from nimble.api import hooks
from nimble.api import middleware
from nimble.api.middleware import auth_token
from mogan.api import config
from mogan.api import hooks
from mogan.api import middleware
from mogan.api.middleware import auth_token
def get_pecan_config():

View File

@ -23,8 +23,8 @@ server = {
# Pecan Application Configurations
# See https://pecan.readthedocs.org/en/latest/configuration.html#application-configuration # noqa
app = {
'root': 'nimble.api.controllers.root.RootController',
'modules': ['nimble.api'],
'root': 'mogan.api.controllers.root.RootController',
'modules': ['mogan.api'],
'static_root': '%(confdir)s/public',
'debug': False,
'acl_public_routes': [

View File

@ -16,7 +16,7 @@
import pecan
from wsme import types as wtypes
from nimble.api.controllers import base
from mogan.api.controllers import base
def build_url(resource, resource_args, bookmark=False, base_url=None):

View File

@ -17,9 +17,9 @@ import pecan
from pecan import rest
from wsme import types as wtypes
from nimble.api.controllers import base
from nimble.api.controllers import v1
from nimble.api import expose
from mogan.api.controllers import base
from mogan.api.controllers import v1
from mogan.api import expose
ID_VERSION1 = 'v1'
@ -35,8 +35,8 @@ class Root(base.APIBase):
@staticmethod
def convert():
root = Root()
root.name = "OpenStack Nimble API"
root.description = ("Nimble is an OpenStack project which aims to "
root.name = "OpenStack Mogan API"
root.description = ("Mogan is an OpenStack project which aims to "
"facilitate baremetal machines management.")
return root
@ -59,7 +59,7 @@ class RootController(rest.RestController):
def _route(self, args):
"""Overrides the default routing behavior.
It redirects the request to the default version of the nimble API
It redirects the request to the default version of the mogan API
if the version number is not specified in the url.
"""

View File

@ -23,12 +23,12 @@ import pecan
from pecan import rest
from wsme import types as wtypes
from nimble.api.controllers import base
from nimble.api.controllers import link
from nimble.api.controllers.v1 import availability_zone
from nimble.api.controllers.v1 import instance_types
from nimble.api.controllers.v1 import instances
from nimble.api import expose
from mogan.api.controllers import base
from mogan.api.controllers import link
from mogan.api.controllers.v1 import availability_zone
from mogan.api.controllers.v1 import instance_types
from mogan.api.controllers.v1 import instances
from mogan.api import expose
class V1(base.APIBase):

View File

@ -17,8 +17,8 @@ import pecan
from pecan import rest
from wsme import types as wtypes
from nimble.api.controllers import base
from nimble.api import expose
from mogan.api.controllers import base
from mogan.api import expose
class AvailabilityZones(base.APIBase):

View File

@ -19,13 +19,13 @@ from six.moves import http_client
import wsme
from wsme import types as wtypes
from nimble.api.controllers import base
from nimble.api.controllers import link
from nimble.api.controllers.v1 import types
from nimble.api import expose
from nimble.common import exception
from nimble.common.i18n import _
from nimble import objects
from mogan.api.controllers import base
from mogan.api.controllers import link
from mogan.api.controllers.v1 import types
from mogan.api import expose
from mogan.common import exception
from mogan.common.i18n import _
from mogan import objects
class InstanceType(base.APIBase):

View File

@ -23,17 +23,17 @@ from six.moves import http_client
import wsme
from wsme import types as wtypes
from nimble.api.controllers import base
from nimble.api.controllers import link
from nimble.api.controllers.v1 import types
from nimble.api.controllers.v1 import utils as api_utils
from nimble.api import expose
from nimble.common import exception
from nimble.common.i18n import _
from nimble.common.i18n import _LW
from nimble.common import policy
from nimble.engine.baremetal import ironic_states as ir_states
from nimble import objects
from mogan.api.controllers import base
from mogan.api.controllers import link
from mogan.api.controllers.v1 import types
from mogan.api.controllers.v1 import utils as api_utils
from mogan.api import expose
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common.i18n import _LW
from mogan.common import policy
from mogan.engine.baremetal import ironic_states as ir_states
from mogan import objects
_DEFAULT_INSTANCE_RETURN_FIELDS = ('uuid', 'name', 'description',
'status')
@ -112,7 +112,7 @@ class InstanceStatesController(rest.RestController):
self._resource = objects.Instance.get(pecan.request.context, uuid)
return self._resource
@policy.authorize_wsgi("nimble:instance", "get_states")
@policy.authorize_wsgi("mogan:instance", "get_states")
@expose.expose(InstanceStates, types.uuid)
def get(self, instance_uuid):
"""List the states of the instance, just support power state at present.
@ -125,7 +125,7 @@ class InstanceStatesController(rest.RestController):
rpc_instance)
return InstanceStates(**rpc_states)
@policy.authorize_wsgi("nimble:instance", "set_power_state")
@policy.authorize_wsgi("mogan:instance", "set_power_state")
@expose.expose(None, types.uuid, wtypes.text,
status_code=http_client.ACCEPTED)
def power(self, instance_uuid, target):
@ -304,7 +304,7 @@ class InstanceController(rest.RestController):
if node_list:
node_dict = {node['instance_uuid']: node for node in node_list
if node['instance_uuid']}
# Merge nimble instance info with ironic node power state
# Merge mogan instance info with ironic node power state
for instance_data in instances_data:
uuid = instance_data['uuid']
if uuid in node_dict:
@ -330,7 +330,7 @@ class InstanceController(rest.RestController):
return self._get_instance_collection(fields=fields,
all_tenants=all_tenants)
@policy.authorize_wsgi("nimble:instance", "get")
@policy.authorize_wsgi("mogan:instance", "get")
@expose.expose(Instance, types.uuid, types.listtype)
def get_one(self, instance_uuid, fields=None):
"""Retrieve information about the given instance.
@ -368,7 +368,7 @@ class InstanceController(rest.RestController):
raise exception.NotFound()
return self._get_instance_collection(all_tenants=all_tenants)
@policy.authorize_wsgi("nimble:instance", "create", False)
@policy.authorize_wsgi("mogan:instance", "create", False)
@expose.expose(Instance, body=types.jsontype,
status_code=http_client.CREATED)
def post(self, instance):
@ -418,7 +418,7 @@ class InstanceController(rest.RestController):
pecan.response.location = link.build_url('instance', instance.uuid)
return Instance.convert_with_links(instance)
@policy.authorize_wsgi("nimble:instance", "update")
@policy.authorize_wsgi("mogan:instance", "update")
@wsme.validate(types.uuid, [InstancePatchType])
@expose.expose(Instance, types.uuid, body=[InstancePatchType])
def patch(self, instance_uuid, patch):
@ -451,7 +451,7 @@ class InstanceController(rest.RestController):
return Instance.convert_with_links(rpc_instance)
@policy.authorize_wsgi("nimble:instance", "delete")
@policy.authorize_wsgi("mogan:instance", "delete")
@expose.expose(None, types.uuid, status_code=http_client.NO_CONTENT)
def delete(self, instance_uuid):
"""Delete a instance.

View File

@ -22,8 +22,8 @@ import six
import wsme
from wsme import types as wtypes
from nimble.common import exception
from nimble.common.i18n import _
from mogan.common import exception
from mogan.common.i18n import _
class UuidType(wtypes.UserType):
@ -133,7 +133,7 @@ class JsonPatchType(wtypes.Base):
value = wsme.wsattr(jsontype, default=wtypes.Unset)
# The class of the objects being patched. Override this in subclasses.
# Should probably be a subclass of nimble.api.controllers.base.APIBase.
# Should probably be a subclass of mogan.api.controllers.base.APIBase.
_api_base = None
# Attributes that are not required for construction, but which may not be

View File

@ -17,7 +17,7 @@ import jsonpatch
from oslo_config import cfg
import wsme
from nimble.common.i18n import _
from mogan.common.i18n import _
CONF = cfg.CONF

View File

@ -19,9 +19,9 @@ from oslo_context import context
from pecan import hooks
from six.moves import http_client
from nimble.common import policy
from nimble.db import api as dbapi
from nimble.engine import api as engineapi
from mogan.common import policy
from mogan.db import api as dbapi
from mogan.engine import api as engineapi
class ConfigHook(hooks.PecanHook):

View File

@ -12,8 +12,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from nimble.api.middleware import auth_token
from nimble.api.middleware import parsable_error
from mogan.api.middleware import auth_token
from mogan.api.middleware import parsable_error
ParsableErrorMiddleware = parsable_error.ParsableErrorMiddleware

View File

@ -17,9 +17,9 @@ import re
from keystonemiddleware import auth_token
from oslo_log import log
from nimble.common import exception
from nimble.common.i18n import _
from nimble.common import utils
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common import utils
LOG = log.getLogger(__name__)

View File

@ -15,4 +15,4 @@
import oslo_i18n as i18n
i18n.install('nimble')
i18n.install('mogan')

View File

@ -13,23 +13,23 @@
# License for the specific language governing permissions and limitations
# under the License.
"""The Nimble Service API."""
"""The Mogan Service API."""
import sys
from oslo_config import cfg
from nimble.common import service as nimble_service
from mogan.common import service as mogan_service
CONF = cfg.CONF
def main():
# Parse config file and command line options, then start logging
nimble_service.prepare_service(sys.argv)
mogan_service.prepare_service(sys.argv)
# Build and start the WSGI app
launcher = nimble_service.process_launcher()
server = nimble_service.WSGIService('nimble_api', CONF.api.enable_ssl_api)
launcher = mogan_service.process_launcher()
server = mogan_service.WSGIService('mogan_api', CONF.api.enable_ssl_api)
launcher.launch_service(server, workers=server.workers)
launcher.wait()

View File

@ -21,10 +21,10 @@ import sys
from oslo_config import cfg
from nimble.common.i18n import _
from nimble.common import service
from nimble.conf import CONF
from nimble.db import migration
from mogan.common.i18n import _
from mogan.common import service
from mogan.conf import CONF
from mogan.db import migration
class DBCommand(object):

View File

@ -14,7 +14,7 @@
# under the License.
"""
The Nimble Management Service
The Mogan Management Service
"""
import sys
@ -22,20 +22,20 @@ import sys
from oslo_config import cfg
from oslo_service import service
from nimble.common import constants
from nimble.common import service as nimble_service
from mogan.common import constants
from mogan.common import service as mogan_service
CONF = cfg.CONF
def main():
# Parse config file and command line options, then start logging
nimble_service.prepare_service(sys.argv)
mogan_service.prepare_service(sys.argv)
mgr = nimble_service.RPCService(CONF.host,
'nimble.engine.manager',
'EngineManager',
constants.MANAGER_TOPIC)
mgr = mogan_service.RPCService(CONF.host,
'mogan.engine.manager',
'EngineManager',
constants.MANAGER_TOPIC)
launcher = service.launch(CONF, mgr)
launcher.wait()

View File

@ -15,14 +15,14 @@
from oslo_config import cfg
from nimble.common import rpc
from nimble import version
from mogan.common import rpc
from mogan import version
def parse_args(argv, default_config_files=None):
rpc.set_defaults(control_exchange='nimble')
rpc.set_defaults(control_exchange='mogan')
cfg.CONF(argv[1:],
project='nimble',
project='mogan',
version=version.version_info.release_string(),
default_config_files=default_config_files)
rpc.init(cfg.CONF)

View File

@ -14,4 +14,4 @@
# under the License.
MANAGER_TOPIC = 'nimble.engine_manager'
MANAGER_TOPIC = 'mogan.engine_manager'

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""Nimble base exception handling.
"""Mogan base exception handling.
SHOULD include dedicated exception logging.
@ -24,15 +24,15 @@ from oslo_versionedobjects import exception as obj_exc
import six
from six.moves import http_client
from nimble.common.i18n import _
from nimble.common.i18n import _LE
from nimble.conf import CONF
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.conf import CONF
LOG = logging.getLogger(__name__)
class NimbleException(Exception):
"""Base Nimble Exception
"""Base Mogan Exception
To correctly use this class, inherit from it and define
a '_msg_fmt' property. That message will get printf'd

View File

@ -31,7 +31,7 @@ def _make_task_name(cls, addons=None):
class NimbleTask(task.Task):
"""The root task class for all nimble tasks.
"""The root task class for all mogan tasks.
It automatically names the given task using the module and class that
implement the given task as the task name.

View File

@ -15,7 +15,7 @@
import oslo_i18n as i18n
_translators = i18n.TranslatorFactory(domain='nimble')
_translators = i18n.TranslatorFactory(domain='mogan')
# The primary translation function using the well-known name "_"
_ = _translators.primary

View File

@ -18,8 +18,8 @@ from ironicclient import exc as ironic_exc
from oslo_config import cfg
from oslo_log import log as logging
from nimble.common import exception
from nimble.common.i18n import _
from mogan.common import exception
from mogan.common.i18n import _
LOG = logging.getLogger(__name__)

View File

@ -20,11 +20,11 @@ from oslo_log import log as logging
import six
from six.moves.urllib import parse # for legacy options loading only
from nimble.common import exception
from nimble.common.i18n import _
from nimble.common.i18n import _LE
from nimble.conf import auth as nimble_auth
from nimble.conf import CONF
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.conf import auth as nimble_auth
from mogan.conf import CONF
LOG = logging.getLogger(__name__)

View File

@ -17,7 +17,7 @@
import os
from nimble.conf import CONF
from mogan.conf import CONF
def basedir_def(*args):

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
"""Policy Engine For Nimble."""
"""Policy Engine For Mogan."""
import functools
from oslo_concurrency import lockutils
@ -25,8 +25,8 @@ import pecan
import sys
import wsme
from nimble.common import exception
from nimble.common.i18n import _LW
from mogan.common import exception
from mogan.common.i18n import _LW
_ENFORCER = None
CONF = cfg.CONF
@ -76,22 +76,22 @@ default_policies = [
# depend on their existence throughout the code.
instance_policies = [
policy.RuleDefault('nimble:instance:get',
policy.RuleDefault('mogan:instance:get',
'rule:default',
description='Retrieve Instance records'),
policy.RuleDefault('nimble:instance:get_states',
policy.RuleDefault('mogan:instance:get_states',
'rule:default',
description='View Instance power and provision state'),
policy.RuleDefault('nimble:instance:create',
policy.RuleDefault('mogan:instance:create',
'rule:allow',
description='Create Instance records'),
policy.RuleDefault('nimble:instance:delete',
policy.RuleDefault('mogan:instance:delete',
'rule:default',
description='Delete Instance records'),
policy.RuleDefault('nimble:instance:update',
policy.RuleDefault('mogan:instance:update',
'rule:default',
description='Update Instance records'),
policy.RuleDefault('nimble:instance:set_power_state',
policy.RuleDefault('mogan:instance:set_power_state',
'rule:default',
description='Change Instance power status'),
]
@ -103,7 +103,7 @@ def list_policies():
return policies
@lockutils.synchronized('policy_enforcer', 'nimble-')
@lockutils.synchronized('policy_enforcer', 'mogan-')
def init_enforcer(policy_file=None, rules=None,
default_rule=None, use_conf=True):
"""Synchronously initializes the policy enforcer
@ -178,7 +178,7 @@ def authorize_wsgi(api_name, act=None, need_target=True):
from magnum.common import policy
class InstancesController(rest.RestController):
....
@policy.authorize_wsgi("nimble:instance", "delete")
@policy.authorize_wsgi("mogan:instance", "delete")
@wsme_pecan.wsexpose(None, types.uuid_or_name, status_code=204)
def delete(self, bay_ident):
...
@ -261,7 +261,7 @@ def enforce(rule, target, creds, do_raise=False, exc=None, *args, **kwargs):
# backwards compatibility in case it has been used downstream.
# It may be removed in the Pike cycle.
LOG.warning(_LW(
"Deprecation warning: calls to nimble.common.policy.enforce() "
"Deprecation warning: calls to mogan.common.policy.enforce() "
"should be replaced with authorize(). This method may be removed "
"in a future release."))

View File

@ -17,7 +17,7 @@ from oslo_config import cfg
from oslo_context import context as nimble_context
import oslo_messaging as messaging
from nimble.common import exception
from mogan.common import exception
CONF = cfg.CONF

View File

@ -20,16 +20,16 @@ from oslo_service import service
from oslo_service import wsgi
from oslo_utils import importutils
from nimble.api import app
from nimble.common import config
from nimble.common import exception
from nimble.common.i18n import _
from nimble.common.i18n import _LE
from nimble.common.i18n import _LI
from nimble.common import rpc
from nimble.conf import CONF
from nimble import objects
from nimble.objects import base as objects_base
from mogan.api import app
from mogan.common import config
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.common.i18n import _LI
from mogan.common import rpc
from mogan.conf import CONF
from mogan import objects
from mogan.objects import base as objects_base
LOG = log.getLogger(__name__)
@ -90,7 +90,7 @@ def prepare_service(argv=None):
log.set_defaults(default_log_levels=CONF.default_log_levels + [
'eventlet.wsgi.server=INFO', 'neutronclient=WARNING'])
config.parse_args(argv)
log.setup(CONF, 'nimble')
log.setup(CONF, 'mogan')
objects.register_all()
@ -99,7 +99,7 @@ def process_launcher():
class WSGIService(service.ServiceBase):
"""Provides ability to launch nimble API from wsgi app."""
"""Provides ability to launch mogan API from wsgi app."""
def __init__(self, name, use_ssl=False):
"""Initialize, but do not start the WSGI server.

View File

@ -20,8 +20,8 @@ import re
from oslo_log import log as logging
import six
from nimble.common import exception
from nimble.common.i18n import _LW
from mogan.common import exception
from mogan.common.i18n import _LW
LOG = logging.getLogger(__name__)

View File

@ -15,15 +15,15 @@
from oslo_config import cfg
from nimble.conf import api
from nimble.conf import database
from nimble.conf import default
from nimble.conf import engine
from nimble.conf import glance
from nimble.conf import ironic
from nimble.conf import keystone
from nimble.conf import neutron
from nimble.conf import scheduler
from mogan.conf import api
from mogan.conf import database
from mogan.conf import default
from mogan.conf import engine
from mogan.conf import glance
from mogan.conf import ironic
from mogan.conf import keystone
from mogan.conf import neutron
from mogan.conf import scheduler
CONF = cfg.CONF

View File

@ -15,28 +15,28 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.StrOpt('host_ip',
default='0.0.0.0',
help=_('The IP address on which nimble-api listens.')),
help=_('The IP address on which mogan-api listens.')),
cfg.PortOpt('port',
default=6688,
help=_('The TCP port on which nimble-api listens.')),
help=_('The TCP port on which mogan-api listens.')),
cfg.IntOpt('max_limit',
default=1000,
help=_('The maximum number of items returned in a single '
'response from a collection resource.')),
cfg.StrOpt('public_endpoint',
help=_("Public URL to use when building the links to the API "
"resources (for example, \"https://nimble.rocks:6688\")."
"resources (for example, \"https://mogan.rocks:6688\")."
" If None the links will be built using the request's "
"host URL. If the API is operating behind a proxy, you "
"will want to change this to represent the proxy's URL. "
"Defaults to None.")),
cfg.IntOpt('api_workers',
help=_('Number of workers for OpenStack Nimble API service. '
help=_('Number of workers for OpenStack Mogan API service. '
'The default is equal to the number of CPUs available '
'if that can be determined, else a default worker '
'count of 1 is returned.')),
@ -51,7 +51,7 @@ opts = [
]
opt_group = cfg.OptGroup(name='api',
title='Options for the nimble-api service')
title='Options for the mogan-api service')
def register_opts(conf):

View File

@ -15,7 +15,7 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.StrOpt('mysql_engine',

View File

@ -18,7 +18,7 @@ import socket
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
api_opts = [
cfg.BoolOpt('debug_tracebacks_in_api',
@ -41,15 +41,15 @@ path_opts = [
cfg.StrOpt('pybasedir',
default=os.path.abspath(os.path.join(os.path.dirname(__file__),
'../')),
sample_default='/usr/lib/python/site-packages/nimble/nimble',
help=_('Directory where the nimble python module is '
sample_default='/usr/lib/python/site-packages/mogan/mogan',
help=_('Directory where the mogan python module is '
'installed.')),
cfg.StrOpt('bindir',
default='$pybasedir/bin',
help=_('Directory where nimble binaries are installed.')),
help=_('Directory where mogan binaries are installed.')),
cfg.StrOpt('state_path',
default='$pybasedir',
help=_("Top-level directory for maintaining nimble's state.")),
help=_("Top-level directory for maintaining mogan's state.")),
]
service_opts = [

View File

@ -15,14 +15,14 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.IntOpt('workers_pool_size',
default=100,
help=_('The size of the workers greenthread pool.')),
cfg.StrOpt('api_url',
help=_('URL of Nimble API service. If not set nimble can '
help=_('URL of Mogan API service. If not set mogan can '
'get the current value from the keystone service '
'catalog.')),
cfg.IntOpt('periodic_max_workers',
@ -35,7 +35,7 @@ opts = [
help=_('Interval between syncing the node resources from '
'ironic, in seconds.')),
cfg.StrOpt('scheduler_driver',
default='nimble.engine.scheduler.filter_scheduler.'
default='mogan.engine.scheduler.filter_scheduler.'
'FilterScheduler',
help=_('Default scheduler driver to use')),
cfg.StrOpt('default_schedule_zone',

View File

@ -17,12 +17,12 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.ListOpt('glance_api_servers',
required=True,
help=_('A list of the glance api servers available to nimble. '
help=_('A list of the glance api servers available to mogan. '
'Prefix with https:// for SSL-based glance API '
'servers. Format is [hostname|IP]:port.')),
cfg.BoolOpt('glance_api_insecure',

View File

@ -13,7 +13,7 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.StrOpt('region_name',

View File

@ -13,8 +13,8 @@
from oslo_config import cfg
from nimble.common.i18n import _
from nimble.conf import auth
from mogan.common.i18n import _
from mogan.conf import auth
opts = [
cfg.StrOpt('url',

View File

@ -12,44 +12,44 @@
import itertools
import nimble.conf.api
import nimble.conf.database
import nimble.conf.default
import nimble.conf.engine
import nimble.conf.glance
import nimble.conf.ironic
import nimble.conf.keystone
import nimble.conf.neutron
import nimble.conf.scheduler
import mogan.conf.api
import mogan.conf.database
import mogan.conf.default
import mogan.conf.engine
import mogan.conf.glance
import mogan.conf.ironic
import mogan.conf.keystone
import mogan.conf.neutron
import mogan.conf.scheduler
_default_opt_lists = [
nimble.conf.default.api_opts,
nimble.conf.default.exc_log_opts,
nimble.conf.default.path_opts,
nimble.conf.default.service_opts,
mogan.conf.default.api_opts,
mogan.conf.default.exc_log_opts,
mogan.conf.default.path_opts,
mogan.conf.default.service_opts,
]
_opts = [
('DEFAULT', itertools.chain(*_default_opt_lists)),
('api', nimble.conf.api.opts),
('database', nimble.conf.database.opts),
('engine', nimble.conf.engine.opts),
('glance', nimble.conf.glance.opts),
('ironic', nimble.conf.ironic.opts),
('keystone', nimble.conf.keystone.opts),
('neutron', nimble.conf.neutron.opts),
('scheduler', nimble.conf.scheduler.opts),
('api', mogan.conf.api.opts),
('database', mogan.conf.database.opts),
('engine', mogan.conf.engine.opts),
('glance', mogan.conf.glance.opts),
('ironic', mogan.conf.ironic.opts),
('keystone', mogan.conf.keystone.opts),
('neutron', mogan.conf.neutron.opts),
('scheduler', mogan.conf.scheduler.opts),
]
def list_opts():
"""Return a list of oslo.config options available in Nimble code.
"""Return a list of oslo.config options available in Mogan code.
The returned list includes all oslo.config options. Each element of
the list is a tuple. The first element is the name of the group, the
second element is the options.
The function is discoverable via the 'nimble' entry point under the
The function is discoverable via the 'mogan' entry point under the
'oslo.config.opts' namespace.
The function is used by Oslo sample config file generator to discover the

View File

@ -15,15 +15,15 @@
from oslo_config import cfg
from nimble.common.i18n import _
from mogan.common.i18n import _
opts = [
cfg.StrOpt('scheduler_driver',
default='nimble.engine.scheduler.filter_scheduler.'
default='mogan.engine.scheduler.filter_scheduler.'
'FilterScheduler',
help=_('Default scheduler driver to use')),
cfg.StrOpt('scheduler_node_manager',
default='nimble.engine.scheduler.node_manager.NodeManager',
default='mogan.engine.scheduler.node_manager.NodeManager',
help=_('The scheduler node manager class to use')),
cfg.IntOpt('scheduler_max_attempts',
default=3,
@ -44,7 +44,7 @@ opts = [
help=_('Which weigher class names to use for weighing '
'nodes.')),
cfg.StrOpt('scheduler_weight_handler',
default='nimble.engine.scheduler.weights.'
default='mogan.engine.scheduler.weights.'
'OrderedNodeWeightHandler',
help=_('Which handler to use for selecting the node after '
'weighing')),

View File

@ -23,7 +23,7 @@ from oslo_db import api as db_api
import six
_BACKEND_MAPPING = {'sqlalchemy': 'nimble.db.sqlalchemy.api'}
_BACKEND_MAPPING = {'sqlalchemy': 'mogan.db.sqlalchemy.api'}
IMPL = db_api.DBAPI.from_config(cfg.CONF, backend_mapping=_BACKEND_MAPPING,
lazy=True)

View File

@ -26,7 +26,7 @@ def get_backend():
global _IMPL
if not _IMPL:
cfg.CONF.import_opt('backend', 'oslo_db.options', group='database')
_IMPL = driver.DriverManager("nimble.database.migration_backend",
_IMPL = driver.DriverManager("mogan.database.migration_backend",
cfg.CONF.database.backend).driver
return _IMPL

View File

@ -22,7 +22,7 @@ try:
except ImportError:
pass
from nimble.db.sqlalchemy import models
from mogan.db.sqlalchemy import models
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.

View File

@ -25,10 +25,10 @@ from oslo_utils import uuidutils
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.orm import joinedload
from nimble.common import exception
from nimble.common.i18n import _
from nimble.db import api
from nimble.db.sqlalchemy import models
from mogan.common import exception
from mogan.common.i18n import _
from mogan.db import api
from mogan.db.sqlalchemy import models
_CONTEXT = threading.local()

View File

@ -22,7 +22,7 @@ import alembic.migration as alembic_migration
from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import enginefacade
from nimble.db.sqlalchemy import models
from mogan.db.sqlalchemy import models
def _alembic_config():

View File

@ -26,13 +26,13 @@ from sqlalchemy import orm
from sqlalchemy import schema, String, Integer
from sqlalchemy.ext.declarative import declarative_base
from nimble.common import paths
from nimble.conf import CONF
from mogan.common import paths
from mogan.conf import CONF
_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nimble.sqlite')
_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('mogan.sqlite')
db_options.set_defaults(CONF, _DEFAULT_SQL_CONNECTION, 'nimble.sqlite')
db_options.set_defaults(CONF, _DEFAULT_SQL_CONNECTION, 'mogan.sqlite')
def table_args():

View File

@ -18,12 +18,12 @@
from oslo_log import log
from oslo_utils import timeutils
from nimble.common import exception
from nimble.conf import CONF
from nimble.engine import rpcapi
from nimble.engine import status
from nimble import image
from nimble import objects
from mogan.common import exception
from mogan.conf import CONF
from mogan.engine import rpcapi
from mogan.engine import status
from mogan import image
from mogan import objects
LOG = log.getLogger(__name__)

View File

@ -16,8 +16,8 @@
from ironicclient import exceptions as client_e
from oslo_log import log as logging
from nimble.common.i18n import _LE
from nimble.engine.baremetal import ironic_states
from mogan.common.i18n import _LE
from mogan.engine.baremetal import ironic_states
LOG = logging.getLogger(__name__)

View File

@ -19,13 +19,13 @@ from eventlet import greenpool
from oslo_service import periodic_task
from oslo_utils import importutils
from nimble.common.i18n import _
from nimble.common import ironic
from nimble.common import rpc
from nimble.conf import CONF
from nimble.db import api as dbapi
from nimble.engine import rpcapi
from nimble import network
from mogan.common.i18n import _
from mogan.common import ironic
from mogan.common import rpc
from mogan.conf import CONF
from mogan.db import api as dbapi
from mogan.engine import rpcapi
from mogan import network
class BaseEngineManager(periodic_task.PeriodicTasks):

View File

@ -22,15 +22,15 @@ from oslo_utils import timeutils
import taskflow.engines
from taskflow.patterns import linear_flow
from nimble.common import exception
from nimble.common import flow_utils
from nimble.common.i18n import _
from nimble.common.i18n import _LE
from nimble.common.i18n import _LI
from nimble.common import utils
from nimble.engine.baremetal import ironic
from nimble.engine.baremetal import ironic_states
from nimble.engine import status
from mogan.common import exception
from mogan.common import flow_utils
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.common.i18n import _LI
from mogan.common import utils
from mogan.engine.baremetal import ironic
from mogan.engine.baremetal import ironic_states
from mogan.engine import status
LOG = logging.getLogger(__name__)

View File

@ -22,18 +22,18 @@ from oslo_service import loopingcall
from oslo_service import periodic_task
import six
from nimble.common import exception
from nimble.common import flow_utils
from nimble.common.i18n import _
from nimble.common.i18n import _LE
from nimble.common.i18n import _LI
from nimble.common.i18n import _LW
from nimble.conf import CONF
from nimble.engine.baremetal import ironic
from nimble.engine.baremetal import ironic_states
from nimble.engine import base_manager
from nimble.engine.flows import create_instance
from nimble.engine import status
from mogan.common import exception
from mogan.common import flow_utils
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.common.i18n import _LI
from mogan.common.i18n import _LW
from mogan.conf import CONF
from mogan.engine.baremetal import ironic
from mogan.engine.baremetal import ironic_states
from mogan.engine import base_manager
from mogan.engine.flows import create_instance
from mogan.engine import status
LOG = log.getLogger(__name__)
@ -43,7 +43,7 @@ _UNPROVISION_STATES = (ironic_states.ACTIVE, ironic_states.DEPLOYFAIL,
class EngineManager(base_manager.BaseEngineManager):
"""Nimble Engine manager main class."""
"""Mogan Engine manager main class."""
RPC_API_VERSION = '1.0'

View File

@ -18,9 +18,9 @@ Client side of the engine RPC API.
from oslo_config import cfg
import oslo_messaging as messaging
from nimble.common import constants
from nimble.common import rpc
from nimble.objects import base as objects_base
from mogan.common import constants
from mogan.common import rpc
from mogan.objects import base as objects_base
CONF = cfg.CONF

View File

@ -19,8 +19,8 @@ Filter support
from oslo_log import log as logging
import six
from nimble.common.i18n import _LI
from nimble.engine.scheduler import base_handler
from mogan.common.i18n import _LI
from mogan.engine.scheduler import base_handler
LOG = logging.getLogger(__name__)

View File

@ -21,7 +21,7 @@ import abc
import six
from nimble.engine.scheduler import base_handler
from mogan.engine.scheduler import base_handler
def normalize(weight_list, minval=None, maxval=None):

View File

@ -22,7 +22,7 @@ Scheduler base class that all Schedulers should inherit from
from oslo_config import cfg
from oslo_utils import importutils
from nimble.common.i18n import _
from mogan.common.i18n import _
CONF = cfg.CONF

View File

@ -20,10 +20,12 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from nimble.common import exception
from nimble.common.i18n import _, _LE, _LW
from nimble.engine.scheduler import driver
from nimble.engine.scheduler import scheduler_options
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common.i18n import _LE
from mogan.common.i18n import _LW
from mogan.engine.scheduler import driver
from mogan.engine.scheduler import scheduler_options
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@ -124,7 +126,7 @@ class FilterScheduler(driver.Scheduler):
Returned list is ordered by their fitness.
"""
# Since Nimble is using mixed filters from Oslo and it's own, which
# Since Mogan is using mixed filters from Oslo and it's own, which
# takes 'resource_XX' and 'instance_XX' as input respectively, copying
# 'instance_type' to 'resource_type' will make both filters happy.
instance_type = resource_type = request_spec.get("instance_type")

View File

@ -17,7 +17,7 @@
Scheduler node filters
"""
from nimble.engine.scheduler import base_filter
from mogan.engine.scheduler import base_filter
class BaseNodeFilter(base_filter.BaseFilter):

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from nimble.engine.scheduler import filters
from mogan.engine.scheduler import filters
class AvailabilityZoneFilter(filters.BaseNodeFilter):

View File

@ -15,8 +15,8 @@
from oslo_log import log as logging
from nimble.engine.scheduler import filters
from nimble.engine.scheduler.filters import extra_specs_ops
from mogan.engine.scheduler import filters
from mogan.engine.scheduler.filters import extra_specs_ops
LOG = logging.getLogger(__name__)

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from nimble.engine.scheduler import filters
from mogan.engine.scheduler import filters
class InstanceTypeFilter(filters.BaseNodeFilter):

View File

@ -18,7 +18,7 @@ import operator
from oslo_serialization import jsonutils
import six
from nimble.engine.scheduler import filters
from mogan.engine.scheduler import filters
class JsonFilter(filters.BaseNodeFilter):

View File

@ -21,8 +21,8 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from nimble.common import exception
from nimble.engine.scheduler import filters
from mogan.common import exception
from mogan.engine.scheduler import filters
CONF = cfg.CONF
@ -46,12 +46,12 @@ class NodeManager(object):
node_state_cls = NodeState
def __init__(self):
self.filter_handler = filters.NodeFilterHandler('nimble.engine.'
self.filter_handler = filters.NodeFilterHandler('mogan.engine.'
'scheduler.filters')
self.filter_classes = self.filter_handler.get_all_classes()
self.weight_handler = importutils.import_object(
CONF.scheduler.scheduler_weight_handler,
'nimble.engine.scheduler.weights')
'mogan.engine.scheduler.weights')
self.weight_classes = self.weight_handler.get_all_classes()
def _choose_node_filters(self, filter_cls_names):

View File

@ -28,7 +28,7 @@ from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils
from nimble.common.i18n import _LE
from mogan.common.i18n import _LE
CONF = cfg.CONF

View File

@ -17,7 +17,7 @@
Scheduler node weights
"""
from nimble.engine.scheduler import base_weight
from mogan.engine.scheduler import base_weight
class WeighedNode(base_weight.WeighedObject):

View File

@ -13,5 +13,5 @@
def API():
# Needed to prevent circular import...
import nimble.image.api
return nimble.image.api.API()
import mogan.image.api
return mogan.image.api.API()

View File

@ -15,13 +15,13 @@ Main abstraction layer for retrieving and storing information about disk
images used by the compute layer.
"""
from nimble.image import glance
from mogan.image import glance
class API(object):
"""Responsible for exposing a relatively stable internal API for other
modules in Nimble to retrieve information about disk images.
modules in Mogan to retrieve information about disk images.
"""
def get(self, context, image_id):

View File

@ -31,9 +31,9 @@ from oslo_utils import timeutils
import six
from six.moves import range
from nimble.common import exception
from nimble.common.i18n import _LE
from nimble import conf
from mogan.common import exception
from mogan.common.i18n import _LE
from mogan import conf
LOG = logging.getLogger(__name__)
CONF = conf.CONF

View File

@ -13,5 +13,5 @@
def API():
# Needed to prevent circular import...
import nimble.network.api
return nimble.network.api.API()
import mogan.network.api
return mogan.network.api.API()

View File

@ -14,10 +14,10 @@ from neutronclient.common import exceptions as neutron_exceptions
from neutronclient.v2_0 import client as clientv20
from oslo_log import log as logging
from nimble.common import exception
from nimble.common.i18n import _
from nimble.common import keystone
from nimble.conf import CONF
from mogan.common import exception
from mogan.common.i18n import _
from mogan.common import keystone
from mogan.conf import CONF
LOG = logging.getLogger(__name__)

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from nimble.common import rpc
from nimble.objects import base
from nimble.objects import fields
from mogan.common import rpc
from mogan.objects import base
from mogan.objects import fields
@base.NimbleObjectRegistry.register_if(False)

View File

@ -25,5 +25,5 @@ def register_all():
# NOTE(danms): You must make sure your object gets imported in this
# function in order for it to be registered by services that may
# need to receive it via RPC.
__import__('nimble.objects.instance_type')
__import__('nimble.objects.instance')
__import__('mogan.objects.instance_type')
__import__('mogan.objects.instance')

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
"""Nimble common internal object model"""
"""Mogan common internal object model"""
from oslo_utils import versionutils
from oslo_versionedobjects import base as object_base
from nimble import objects
from nimble.objects import fields as object_fields
from mogan import objects
from mogan.objects import fields as object_fields
class NimbleObjectRegistry(object_base.VersionedObjectRegistry):
@ -28,7 +28,7 @@ class NimbleObjectRegistry(object_base.VersionedObjectRegistry):
def registration_hook(self, cls, index):
# NOTE(jroll): blatantly stolen from nova
# NOTE(danms): This is called when an object is registered,
# and is responsible for maintaining nimble.objects.$OBJECT
# and is responsible for maintaining mogan.objects.$OBJECT
# as the highest-versioned implementation of a given object.
version = versionutils.convert_version_to_tuple(cls.VERSION)
if not hasattr(objects, cls.obj_name()):
@ -70,7 +70,7 @@ class NimbleObject(object_base.VersionedObject):
"""
OBJ_SERIAL_NAMESPACE = 'nimble_object'
OBJ_PROJECT_NAMESPACE = 'nimble'
OBJ_PROJECT_NAMESPACE = 'mogan'
# TODO(lintan) Refactor these fields and create PersistentObject and
# TimeStampObject like Nova when it is necessary.

View File

@ -20,7 +20,7 @@ import six
from oslo_versionedobjects import fields as object_fields
from nimble.common import utils
from mogan.common import utils
Field = object_fields.Field
ObjectField = object_fields.ObjectField

View File

@ -16,9 +16,9 @@
from oslo_versionedobjects import base as object_base
from nimble.db import api as dbapi
from nimble.objects import base
from nimble.objects import fields as object_fields
from mogan.db import api as dbapi
from mogan.objects import base
from mogan.objects import fields as object_fields
@base.NimbleObjectRegistry.register

Some files were not shown because too many files have changed in this diff Show More