Browse Source

Default to zero verbosity when using Ansible.

The OpenStack CLI defaults to 1 level of verbosity
which was being directly passed to Ansible methods.
When the CLI is given "-v", the verbosity level is set to 2.
This patch ensures that Ansible will not be verbose by default.
This lowers the amount of RAM a default
deployment/update/upgrade will use along with lowering
log file sizes.

Conflicts:
	tripleoclient/tests/v1/overcloud_external_update/test_overcloud_external_update.py
	tripleoclient/tests/v1/overcloud_external_upgrade/test_overcloud_external_upgrade.py
	tripleoclient/utils.py
	tripleoclient/v1/overcloud_deploy.py
	tripleoclient/v1/overcloud_external_update.py
	tripleoclient/v1/overcloud_external_upgrade.py
	tripleoclient/workflows/deployment.py

Change-Id: Ic59cc6b2b9b979255c10d71e437afa733517e3e1
Signed-off-by: Luke Short <ekultails@gmail.com>
(cherry picked from commit 90eee3abc1)
(cherry picked from commit aef369e7b4)
(cherry picked from commit 36cda0a2b5)
changes/57/704757/2
Luke Short 1 month ago
parent
commit
b3ba675b9a
9 changed files with 19 additions and 18 deletions
  1. +2
    -2
      tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py
  2. +4
    -4
      tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py
  3. +5
    -5
      tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py
  4. +1
    -1
      tripleoclient/utils.py
  5. +3
    -2
      tripleoclient/v1/overcloud_deploy.py
  6. +1
    -1
      tripleoclient/v1/overcloud_ffwd_upgrade.py
  7. +1
    -1
      tripleoclient/v1/overcloud_update.py
  8. +1
    -1
      tripleoclient/v1/overcloud_upgrade.py
  9. +1
    -1
      tripleoclient/workflows/deployment.py

+ 2
- 2
tripleoclient/tests/v1/overcloud_ffwd_upgrade/test_overcloud_ffwd_upgrade.py View File

@@ -160,7 +160,7 @@ class TestFFWDUpgradeRun(fakes.TestFFWDUpgradeRun):
playbook=constants.FFWD_UPGRADE_PLAYBOOK,
node_user='heat-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -185,7 +185,7 @@ class TestFFWDUpgradeRun(fakes.TestFFWDUpgradeRun):
playbook=constants.FFWD_UPGRADE_PLAYBOOK,
node_user='my-user',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',


+ 4
- 4
tripleoclient/tests/v1/overcloud_update/test_overcloud_update.py View File

@@ -151,7 +151,7 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun):
playbook='fake-playbook.yaml',
node_user='tripleo-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -181,7 +181,7 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun):
playbook=book,
node_user='heat-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -210,7 +210,7 @@ class TestOvercloudUpdateRun(fakes.TestOvercloudUpdateRun):
playbook=book,
node_user='heat-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -237,7 +237,7 @@ class TestOvercloudUpdateConverge(fakes.TestOvercloudUpdateConverge):

# Get the command object to test
app_args = mock.Mock()
app_args.verbose_level = 1
app_args.verbose_level = 0
self.cmd = overcloud_update.UpdateConverge(self.app, app_args)

@mock.patch(


+ 5
- 5
tripleoclient/tests/v1/overcloud_upgrade/test_overcloud_upgrade.py View File

@@ -165,7 +165,7 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun):
playbook='fake-playbook.yaml',
node_user='tripleo-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -197,7 +197,7 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun):
playbook=book,
node_user='heat-admin',
skip_tags='validation',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -227,7 +227,7 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun):
playbook='fake-playbook.yaml',
node_user='heat-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -257,7 +257,7 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun):
playbook=book,
node_user='heat-admin',
skip_tags='',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',
@@ -289,7 +289,7 @@ class TestOvercloudUpgradeRun(fakes.TestOvercloudUpgradeRun):
playbook=book,
node_user='heat-admin',
skip_tags='pre-upgrade,validation',
verbosity=1
verbosity=0
)

@mock.patch('tripleoclient.workflows.package_update.update_ansible',


+ 1
- 1
tripleoclient/utils.py View File

@@ -1067,7 +1067,7 @@ def get_tripleo_ansible_inventory(inventory_file='',
def run_update_ansible_action(log, clients, nodes, inventory,
playbook, all_playbooks, ssh_user,
action=None, skip_tags='',
verbosity='1', workdir='', priv_key=''):
verbosity='0', workdir='', priv_key=''):

playbooks = [playbook]
if playbook == "all":


+ 3
- 2
tripleoclient/v1/overcloud_deploy.py View File

@@ -304,7 +304,7 @@ class DeployOvercloud(command.Command):
os.path.abspath(tht_root)))
deployment.deploy_and_wait(
self.log, self.clients, stack,
stack_name, self.app_args.verbose_level,
stack_name, self.app_args.verbose_level - 1,
timeout=timeout,
run_validations=run_validations,
skip_deploy_identifier=skip_deploy_identifier)
@@ -1028,7 +1028,8 @@ class DeployOvercloud(command.Command):
parsed_args.overcloud_ssh_user,
parsed_args.overcloud_ssh_key,
parsed_args.output_dir,
verbosity=self.app_args.verbose_level)
verbosity=(
self.app_args.verbose_level - 1))

# Force fetching of attributes
stack.get()


+ 1
- 1
tripleoclient/v1/overcloud_ffwd_upgrade.py View File

@@ -143,7 +143,7 @@ class FFWDUpgradeRun(command.Command):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args)
oooutils.ffwd_upgrade_operator_confirm(parsed_args.yes, self.log)
verbosity = self.app_args.verbose_level
verbosity = self.app_args.verbose_level - 1
clients = self.app.client_manager

# Run ansible:


+ 1
- 1
tripleoclient/v1/overcloud_update.py View File

@@ -148,7 +148,7 @@ class UpdateRun(command.Command):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args)
clients = self.app.client_manager
verbosity = self.app_args.verbose_level
verbosity = self.app_args.verbose_level - 1
stack = parsed_args.stack

# Run ansible:


+ 1
- 1
tripleoclient/v1/overcloud_upgrade.py View File

@@ -197,7 +197,7 @@ class UpgradeRun(command.Command):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args)
clients = self.app.client_manager
verbosity = self.app_args.verbose_level
verbosity = self.app_args.verbose_level - 1
stack = parsed_args.stack

# Run ansible:


+ 1
- 1
tripleoclient/workflows/deployment.py View File

@@ -246,7 +246,7 @@ def enable_ssh_admin(log, clients, hosts, ssh_user, ssh_key):


def config_download(log, clients, stack, templates,
ssh_user, ssh_key, output_dir, verbosity=1):
ssh_user, ssh_key, output_dir, verbosity=0):
workflow_client = clients.workflow_engine
tripleoclients = clients.tripleoclient



Loading…
Cancel
Save