use - instead of _ in cli opts
To be more consistent with default CLI options like config-file --node-id --policy-engine --delete-missing-driver-datasources Change-Id: Ia6e37e5d743b95f638514b63287b32f43583f8c7
This commit is contained in:
parent
9e97f398ab
commit
c942d89503
|
@ -104,12 +104,12 @@ cli_opts = [
|
|||
help='Use this option to deploy the datasources.'),
|
||||
cfg.BoolOpt('api', default=False,
|
||||
help='Use this option to deploy API service'),
|
||||
cfg.BoolOpt('policy_engine', default=False,
|
||||
cfg.BoolOpt('policy-engine', default=False,
|
||||
help='Use this option to deploy policy engine service.'),
|
||||
cfg.StrOpt('node_id', default=socket.gethostname(),
|
||||
cfg.StrOpt('node-id', default=socket.gethostname(),
|
||||
help='A unique ID for this node. Must be unique across all '
|
||||
'nodes with the same bus_id.'),
|
||||
cfg.BoolOpt('delete_missing_driver_datasources', default=False,
|
||||
cfg.BoolOpt('delete-missing-driver-datasources', default=False,
|
||||
help='Use this option to delete datasources with missing '
|
||||
'drivers from DB')
|
||||
]
|
||||
|
|
|
@ -142,7 +142,7 @@ def initialize_policy_engine(engine):
|
|||
def create_datasources(bus):
|
||||
"""Create and register datasource services ."""
|
||||
if cfg.CONF.delete_missing_driver_datasources:
|
||||
# congress server started with --delete_missing_driver_datasources
|
||||
# congress server started with --delete-missing-driver-datasources
|
||||
bus.delete_missing_driver_datasources()
|
||||
|
||||
datasources = db_datasources.get_datasources()
|
||||
|
@ -157,7 +157,7 @@ def create_datasources(bus):
|
|||
except exception.DriverNotFound:
|
||||
LOG.exception("Some datasources could not be loaded, start "
|
||||
"congress server with "
|
||||
"--delete_missing_driver_datasources option to "
|
||||
"--delete-missing-driver-datasources option to "
|
||||
"clean up stale datasources in DB.")
|
||||
sys.exit(1)
|
||||
except Exception:
|
||||
|
|
|
@ -155,7 +155,7 @@ def main():
|
|||
sys.exit("ERROR: can only be used with distributed arch")
|
||||
if (cfg.CONF.node_id is None and
|
||||
not (deploy_api and deploy_policy and deploy_datasources)):
|
||||
sys.exit("ERROR: must supply unique node_id")
|
||||
sys.exit("ERROR: must supply unique node-id")
|
||||
|
||||
else:
|
||||
# Start all services
|
||||
|
|
|
@ -31,3 +31,8 @@ class ConfigurationTest(testtools.TestCase):
|
|||
self.assertEqual(1, cfg.CONF.api_workers)
|
||||
self.assertEqual('api-paste.ini', cfg.CONF.api_paste_config)
|
||||
self.assertEqual('keystone', cfg.CONF.auth_strategy)
|
||||
self.assertEqual(False, cfg.CONF.datasources)
|
||||
self.assertEqual(False, cfg.CONF.api)
|
||||
self.assertEqual(False, cfg.CONF.policy_engine)
|
||||
self.assertTrue(hasattr(cfg.CONF, 'node_id')) # default varies
|
||||
self.assertEqual(False, cfg.CONF.delete_missing_driver_datasources)
|
||||
|
|
|
@ -88,7 +88,7 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
|
||||
# start all services on replica node
|
||||
api = self.start_service('api', conf_file)
|
||||
pe = self.start_service('policy_engine', conf_file)
|
||||
pe = self.start_service('policy-engine', conf_file)
|
||||
data = self.start_service('datasources', conf_file)
|
||||
|
||||
assert port_num not in self.replicas
|
||||
|
@ -109,7 +109,7 @@ class TestHA(manager_congress.ScenarioPolicyBase):
|
|||
service = '--' + name
|
||||
node = name + '-replica-node'
|
||||
args = ['/usr/bin/python', 'bin/congress-server', service,
|
||||
'--node_id', node, '--config-file', conf_file]
|
||||
'--node-id', node, '--config-file', conf_file]
|
||||
|
||||
p = subprocess.Popen(args, stdout=out, stderr=err,
|
||||
cwd=helper.root_path())
|
||||
|
|
|
@ -179,9 +179,9 @@ function start_congress_service_and_check {
|
|||
# Start the congress services in seperate processes
|
||||
echo_summary "Installing congress services"
|
||||
|
||||
run_process congress-api "python $CONGRESS_BIN_DIR/congress-server --api --node_id=apinode $CFG_FILE_OPTIONS"
|
||||
run_process congress-engine "python $CONGRESS_BIN_DIR/congress-server --policy_engine --node_id=enginenode $CFG_FILE_OPTIONS"
|
||||
run_process congress-datasources "python $CONGRESS_BIN_DIR/congress-server --datasources --node_id=datanode $CFG_FILE_OPTIONS"
|
||||
run_process congress-api "python $CONGRESS_BIN_DIR/congress-server --api --node-id=apinode $CFG_FILE_OPTIONS"
|
||||
run_process congress-engine "python $CONGRESS_BIN_DIR/congress-server --policy-engine --node-id=enginenode $CFG_FILE_OPTIONS"
|
||||
run_process congress-datasources "python $CONGRESS_BIN_DIR/congress-server --datasources --node-id=datanode $CFG_FILE_OPTIONS"
|
||||
|
||||
echo "Waiting for Congress to start..."
|
||||
# FIXME(arosen): using curl right now to check if congress is alive once we implement version use check below.
|
||||
|
|
|
@ -50,13 +50,13 @@ New config settings for setting the DSE node type:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
$ python /usr/local/bin/congress-server --api --policy_engine --node_id=<api_unique_id>
|
||||
$ python /usr/local/bin/congress-server --api --policy-engine --node-id=<api_unique_id>
|
||||
|
||||
- One single DSD node
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ python /usr/local/bin/congress-server --datasources --node_id=<datasource_unique_id>
|
||||
$ python /usr/local/bin/congress-server --datasources --node-id=<datasource_unique_id>
|
||||
|
||||
HA for DataSource Node
|
||||
----------------------
|
||||
|
|
|
@ -200,7 +200,7 @@ congress_start() {
|
|||
|
||||
su ${OCF_RESKEY_user} -s /bin/sh -c "${OCF_RESKEY_binary} \
|
||||
--config-file=$OCF_RESKEY_config --datasources \
|
||||
--node_id=$OCF_RESKEY_node_id \
|
||||
--node-id=$OCF_RESKEY_node_id \
|
||||
$OCF_RESKEY_additional_parameters"' >> /dev/null 2>&1 & echo $!' \
|
||||
> $OCF_RESKEY_pid
|
||||
|
||||
|
|
Loading…
Reference in New Issue