diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index c6908a8e5..06ccebd1a 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -32,13 +32,8 @@ DEFAULT_ENV_DIRECTORY = "~/.tripleo/environments" TRIPLEO_PUPPET_MODULES = "/usr/share/openstack-puppet/modules/" PUPPET_MODULES = "/etc/puppet/modules/" PUPPET_BASE = "/etc/puppet/" -# Update Queue -UPDATE_QUEUE = 'update' -UPGRADE_QUEUE = 'upgrade' -FFWD_UPGRADE_QUEUE = 'ffwdupgrade' -CEPH_UPGRADE_QUEUE = 'cephupgrade' -STACK_TIMEOUT = 240 +STACK_TIMEOUT = 240 # The default ffwd upgrade ansible playbooks generated from heat stack output FFWD_UPGRADE_PLAYBOOK = "fast_forward_upgrade_playbook.yaml" diff --git a/tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py b/tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py index 4a6c9083d..58e6eecbf 100644 --- a/tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py +++ b/tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py @@ -156,7 +156,6 @@ class TestFFWDUpgradeRun(fakes.TestFFWDUpgradeRun): upgrade_ansible.assert_called_once_with( self.app.client_manager, inventory_file=mock_open().read(), - ansible_queue_name=constants.FFWD_UPGRADE_QUEUE, nodes='', playbook=constants.FFWD_UPGRADE_PLAYBOOK, node_user='heat-admin', @@ -181,7 +180,6 @@ class TestFFWDUpgradeRun(fakes.TestFFWDUpgradeRun): upgrade_ansible.assert_called_once_with( self.app.client_manager, inventory_file=mock_open().read(), - ansible_queue_name=constants.FFWD_UPGRADE_QUEUE, nodes='', playbook=constants.FFWD_UPGRADE_PLAYBOOK, node_user='my-user', diff --git a/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py b/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py index 9bf4baeba..aecea8cbf 100644 --- a/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py +++ b/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py @@ -149,7 +149,6 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun): nodes='Compute', inventory_file=mock_open().read(), playbook='fake-playbook.yaml', - ansible_queue_name=constants.UPDATE_QUEUE, node_user='tripleo-admin', skip_tags='' ) @@ -179,7 +178,6 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun): nodes='Compute', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPDATE_QUEUE, node_user='heat-admin', skip_tags='' ) @@ -208,7 +206,6 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun): nodes=None, inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPDATE_QUEUE, node_user='heat-admin', skip_tags='' ) diff --git a/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py b/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py index 7c91a65bf..e4143dbe6 100644 --- a/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py +++ b/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py @@ -163,7 +163,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='Compute, Controller', inventory_file=mock_open().read(), playbook='fake-playbook.yaml', - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='tripleo-admin', skip_tags='' ) @@ -195,7 +194,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='Compute', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='heat-admin', skip_tags='validation' ) @@ -225,7 +223,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='compute-0, compute-1', inventory_file=mock_open().read(), playbook='fake-playbook.yaml', - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='heat-admin', skip_tags='' ) @@ -255,7 +252,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='swift-1', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='heat-admin', skip_tags='' ) @@ -287,7 +283,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='swift-1', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='heat-admin', skip_tags='pre-upgrade,validation' ) diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index cec026659..26e79f45a 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -827,16 +827,15 @@ def get_tripleo_ansible_inventory(inventory_file='', def run_update_ansible_action(log, clients, nodes, inventory, playbook, - queue, all_playbooks, action, ssh_user, - skip_tags=''): + all_playbooks, action, ssh_user, skip_tags=''): playbooks = [playbook] if playbook == "all": playbooks = all_playbooks for book in playbooks: log.debug("Running ansible playbook %s " % book) action.update_ansible(clients, nodes=nodes, inventory_file=inventory, - playbook=book, ansible_queue_name=queue, - node_user=ssh_user, skip_tags=skip_tags) + playbook=book, node_user=ssh_user, + skip_tags=skip_tags) def prepend_environment(environment_files, templates_dir, environment): diff --git a/tripleoclient/v1/overcloud_ffwd_upgrade.py b/tripleoclient/v1/overcloud_ffwd_upgrade.py index 8d5811ec4..cb296ddf6 100644 --- a/tripleoclient/v1/overcloud_ffwd_upgrade.py +++ b/tripleoclient/v1/overcloud_ffwd_upgrade.py @@ -67,8 +67,7 @@ class FFWDUpgradePrepare(DeployOvercloud): package_update.run_on_nodes( clients, server_name='all', config_name='ffwd-upgrade-prepare', - config=constants.FFWD_UPGRADE_PREPARE_SCRIPT, group='script', - queue_name=constants.FFWD_UPGRADE_QUEUE) + config=constants.FFWD_UPGRADE_PREPARE_SCRIPT, group='script') ceph_ansible_playbook = parsed_args.ceph_ansible_playbook # In case of update and upgrade we need to force the @@ -155,8 +154,8 @@ class FFWDUpgradeRun(command.Command): limit_hosts = '' oooutils.run_update_ansible_action( self.log, clients, limit_hosts, inventory, - constants.FFWD_UPGRADE_PLAYBOOK, constants.FFWD_UPGRADE_QUEUE, - [], package_update, parsed_args.ssh_user) + constants.FFWD_UPGRADE_PLAYBOOK, [], package_update, + parsed_args.ssh_user) class FFWDUpgradeConverge(DeployOvercloud): diff --git a/tripleoclient/v1/overcloud_update.py b/tripleoclient/v1/overcloud_update.py index eb86e97de..f16cd8ff3 100644 --- a/tripleoclient/v1/overcloud_update.py +++ b/tripleoclient/v1/overcloud_update.py @@ -153,7 +153,7 @@ class UpdateRun(command.Command): inventory = oooutils.get_tripleo_ansible_inventory( parsed_args.static_inventory, parsed_args.ssh_user, stack) oooutils.run_update_ansible_action(self.log, clients, nodes, inventory, - playbook, constants.UPDATE_QUEUE, + playbook, constants.MINOR_UPDATE_PLAYBOOKS, package_update, parsed_args.ssh_user) diff --git a/tripleoclient/v1/overcloud_upgrade.py b/tripleoclient/v1/overcloud_upgrade.py index 635037c2f..f445008d4 100644 --- a/tripleoclient/v1/overcloud_upgrade.py +++ b/tripleoclient/v1/overcloud_upgrade.py @@ -202,7 +202,6 @@ class UpgradeRun(command.Command): skip_tags = self._validate_skip_tags(parsed_args.skip_tags) oooutils.run_update_ansible_action(self.log, clients, limit_hosts, inventory, playbook, - constants.UPGRADE_QUEUE, constants.MAJOR_UPGRADE_PLAYBOOKS, package_update, parsed_args.ssh_user, skip_tags) diff --git a/tripleoclient/workflows/package_update.py b/tripleoclient/workflows/package_update.py index a5ff63c2b..85dff82e4 100644 --- a/tripleoclient/workflows/package_update.py +++ b/tripleoclient/workflows/package_update.py @@ -77,23 +77,19 @@ def get_config(clients, **workflow_input): def update_ansible(clients, **workflow_input): workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient - ansible_queue = workflow_input['ansible_queue_name'] - with tripleoclients.messaging_websocket(ansible_queue) as update_ws: + with tripleoclients.messaging_websocket() as ws: execution = base.start_workflow( workflow_client, 'tripleo.package_update.v1.update_nodes', workflow_input=workflow_input ) - for payload in base.wait_for_messages(workflow_client, - update_ws, - execution): - if payload.get('message'): - pprint.pprint(payload['message'].splitlines()) + for payload in base.wait_for_messages(workflow_client, ws, execution): + print(payload['message']) if payload['status'] == 'SUCCESS': - print('Success') + print("Success") else: raise RuntimeError('Update failed with: {}'.format(payload)) @@ -154,8 +150,7 @@ def ffwd_converge_nodes(clients, **workflow_input): workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient - with tripleoclients.messaging_websocket( - workflow_input['queue_name']) as ws: + with tripleoclients.messaging_websocket() as ws: execution = base.start_workflow( workflow_client, 'tripleo.package_update.v1.ffwd_upgrade_converge_plan', @@ -175,8 +170,7 @@ def run_on_nodes(clients, **workflow_input): workflow_client = clients.workflow_engine tripleoclients = clients.tripleoclient - with tripleoclients.messaging_websocket( - workflow_input['queue_name']) as ws: + with tripleoclients.messaging_websocket() as ws: execution = base.start_workflow( workflow_client, 'tripleo.deployment.v1.deploy_on_servers',