config options: conductor live migrate options

Moved conductor live migrate option from
"conductor/tasks/live_migrate.py"
to the new central location
"conf/conductor.py"

Change-Id: I650976969e59754235dbc7243a965b7250f945bc
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Maciej Szankin 2016-04-19 14:25:59 -05:00
parent 044edbe366
commit fd7bc953a1
3 changed files with 12 additions and 13 deletions

View File

@ -10,13 +10,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
import six
from nova.compute import power_state
from nova.conductor.tasks import base
import nova.conf
from nova import exception
from nova.i18n import _
from nova import objects
@ -24,15 +24,7 @@ from nova.scheduler import utils as scheduler_utils
from nova import utils
LOG = logging.getLogger(__name__)
migrate_opt = cfg.IntOpt('migrate_max_retries',
default=-1,
help='Number of times to retry live-migration before failing. '
'If == -1, try until out of hosts. '
'If == 0, only try once, no retries.')
CONF = cfg.CONF
CONF.register_opt(migrate_opt)
CONF = nova.conf.CONF
class LiveMigrationTask(base.TaskBase):

View File

@ -46,6 +46,13 @@ workers = cfg.IntOpt(
help='Number of workers for OpenStack Conductor service. '
'The default will be the number of CPUs available.')
migrate_opt = cfg.IntOpt(
'migrate_max_retries',
default=-1,
help='Number of times to retry live-migration before failing. '
'If == -1, try until out of hosts. '
'If == 0, only try once, no retries.')
ALL_OPTS = [
use_local,
topic,
@ -56,7 +63,9 @@ ALL_OPTS = [
def register_opts(conf):
conf.register_group(conductor_group)
conf.register_opts(ALL_OPTS, group=conductor_group)
conf.register_opts([migrate_opt])
def list_opts():
return {conductor_group: ALL_OPTS}
return {"DEFAULT": [migrate_opt],
conductor_group: ALL_OPTS}

View File

@ -17,7 +17,6 @@ import nova.cloudpipe.pipelib
import nova.cmd.serialproxy
import nova.cmd.spicehtml5proxy
import nova.conductor.rpcapi
import nova.conductor.tasks.live_migrate
import nova.conf
import nova.console.rpcapi
import nova.console.serial
@ -39,7 +38,6 @@ def list_opts():
return [
('DEFAULT',
itertools.chain(
[nova.conductor.tasks.live_migrate.migrate_opt],
[nova.db.base.db_driver_opt],
[nova.servicegroup.api.servicegroup_driver_opt],
nova.db.api.db_opts,