diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index f332eea19..46b24d8ea 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -39,12 +39,7 @@ DEFAULT_ENV_DIRECTORY = os.path.join(os.environ.get('HOME'), 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' -EXTERNAL_UPDATE_QUEUE = 'externalupdate' -EXTERNAL_UPGRADE_QUEUE = 'externalupgrade' + STACK_TIMEOUT = 240 IRONIC_HTTP_BOOT_BIND_MOUNT = '/var/lib/ironic/httpboot' diff --git a/tripleoclient/tests/v1/overcloud_external_update/test_overcloud_external_update.py b/tripleoclient/tests/v1/overcloud_external_update/test_overcloud_external_update.py index 9e014a60a..e212b62a6 100644 --- a/tripleoclient/tests/v1/overcloud_external_update/test_overcloud_external_update.py +++ b/tripleoclient/tests/v1/overcloud_external_update/test_overcloud_external_update.py @@ -15,7 +15,6 @@ import mock -from tripleoclient import constants from tripleoclient.tests.v1.overcloud_external_update import fakes from tripleoclient.v1 import overcloud_external_update @@ -59,7 +58,6 @@ class TestOvercloudExternalUpdateRun(fakes.TestOvercloudExternalUpdateRun): nodes='all', inventory_file=mock_open().read(), playbook='external_update_steps_playbook.yaml', - ansible_queue_name=constants.EXTERNAL_UPDATE_QUEUE, node_user='tripleo-admin', tags='ceph', skip_tags='', diff --git a/tripleoclient/tests/v1/overcloud_external_upgrade/test_overcloud_external_upgrade.py b/tripleoclient/tests/v1/overcloud_external_upgrade/test_overcloud_external_upgrade.py index b85aa86b6..64bca0ab7 100644 --- a/tripleoclient/tests/v1/overcloud_external_upgrade/test_overcloud_external_upgrade.py +++ b/tripleoclient/tests/v1/overcloud_external_upgrade/test_overcloud_external_upgrade.py @@ -15,7 +15,6 @@ import mock -from tripleoclient import constants from tripleoclient.tests.v1.overcloud_external_upgrade import fakes from tripleoclient.v1 import overcloud_external_upgrade @@ -59,7 +58,6 @@ class TestOvercloudExternalUpgradeRun(fakes.TestOvercloudExternalUpgradeRun): nodes='all', inventory_file=mock_open().read(), playbook='external_upgrade_steps_playbook.yaml', - ansible_queue_name=constants.EXTERNAL_UPGRADE_QUEUE, node_user='tripleo-admin', tags='ceph', skip_tags='', 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 94544bb3a..fee239a31 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 @@ -164,7 +164,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', @@ -190,7 +189,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 9dccd839c..9089d85b3 100644 --- a/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py +++ b/tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py @@ -142,7 +142,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', tags='', skip_tags='' @@ -173,7 +172,6 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun): nodes='Compute', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPDATE_QUEUE, node_user='tripleo-admin', tags='', skip_tags='' @@ -203,7 +201,6 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun): nodes='compute-0, compute-1', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPDATE_QUEUE, node_user='tripleo-admin', tags='', 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 f50a87715..b15f5bc8c 100644 --- a/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py +++ b/tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py @@ -162,7 +162,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', tags='', 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='tripleo-admin', tags='', skip_tags='validation' @@ -226,7 +224,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='tripleo-admin', tags='', skip_tags='' @@ -257,7 +254,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='swift-1', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='tripleo-admin', tags='', skip_tags='' @@ -290,7 +286,6 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun): nodes='swift-1', inventory_file=mock_open().read(), playbook=book, - ansible_queue_name=constants.UPGRADE_QUEUE, node_user='tripleo-admin', tags='', skip_tags='pre-upgrade,validation' diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index 688025785..a8c7316bb 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -1027,16 +1027,15 @@ def process_multiple_environments(created_env_files, tht_root, def run_update_ansible_action(log, clients, nodes, inventory, playbook, - queue, all_playbooks, action, ssh_user, - tags='', skip_tags=''): + all_playbooks, action, ssh_user, tags='', + 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, tags=tags, + playbook=book, node_user=ssh_user, tags=tags, skip_tags=skip_tags) diff --git a/tripleoclient/v1/overcloud_external_update.py b/tripleoclient/v1/overcloud_external_update.py index 3ba3ce399..022e99dd3 100644 --- a/tripleoclient/v1/overcloud_external_update.py +++ b/tripleoclient/v1/overcloud_external_update.py @@ -94,7 +94,6 @@ class ExternalUpdateRun(command.Command): playbook = 'all' oooutils.run_update_ansible_action( self.log, clients, limit_hosts, inventory, playbook, - constants.EXTERNAL_UPDATE_QUEUE, constants.EXTERNAL_UPDATE_PLAYBOOKS, package_update, parsed_args.ssh_user, tags=parsed_args.tags, skip_tags=parsed_args.skip_tags) diff --git a/tripleoclient/v1/overcloud_external_upgrade.py b/tripleoclient/v1/overcloud_external_upgrade.py index d1d92f1bd..cbd61d63e 100644 --- a/tripleoclient/v1/overcloud_external_upgrade.py +++ b/tripleoclient/v1/overcloud_external_upgrade.py @@ -94,7 +94,6 @@ class ExternalUpgradeRun(command.Command): playbook = 'all' oooutils.run_update_ansible_action( self.log, clients, limit_hosts, inventory, playbook, - constants.EXTERNAL_UPGRADE_QUEUE, constants.EXTERNAL_UPGRADE_PLAYBOOKS, package_update, parsed_args.ssh_user, tags=parsed_args.tags, skip_tags=parsed_args.skip_tags) diff --git a/tripleoclient/v1/overcloud_ffwd_upgrade.py b/tripleoclient/v1/overcloud_ffwd_upgrade.py index deb0630b2..7b72f73c2 100644 --- a/tripleoclient/v1/overcloud_ffwd_upgrade.py +++ b/tripleoclient/v1/overcloud_ffwd_upgrade.py @@ -65,8 +65,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') # In case of update and upgrade we need to force the # update_plan_only. The heat stack update is done by the @@ -156,8 +155,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 83244ccab..734a1e47e 100644 --- a/tripleoclient/v1/overcloud_update.py +++ b/tripleoclient/v1/overcloud_update.py @@ -153,7 +153,6 @@ class UpdateRun(command.Command): parsed_args.static_inventory, parsed_args.ssh_user, stack) oooutils.run_update_ansible_action(self.log, clients, limit_hosts, inventory, playbook, - constants.UPDATE_QUEUE, 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 0612215f8..fe99d1b00 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, diff --git a/tripleoclient/workflows/package_update.py b/tripleoclient/workflows/package_update.py index ec2b8ad11..2bae5abb0 100644 --- a/tripleoclient/workflows/package_update.py +++ b/tripleoclient/workflows/package_update.py @@ -81,24 +81,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, - _WORKFLOW_TIMEOUT): - 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)) @@ -161,8 +156,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', @@ -183,8 +177,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',