From 57335f665eade1bef7fe64d8f2dfa94463d2c0f6 Mon Sep 17 00:00:00 2001 From: Justin Watts Date: Mon, 13 May 2019 16:03:19 -0400 Subject: [PATCH] Fix TypeError in Latest RC Run --- cfme/automate/buttons.py | 3 ++- cfme/rest/gen_data.py | 2 +- cfme/storage/volume.py | 2 +- cfme/tests/ansible/test_embedded_ansible_automate.py | 8 ++++++-- cfme/tests/storage/test_volume_backup.py | 5 +---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cfme/automate/buttons.py b/cfme/automate/buttons.py index c30bb69053..f2796e0ebc 100644 --- a/cfme/automate/buttons.py +++ b/cfme/automate/buttons.py @@ -404,7 +404,8 @@ def instantiate( args = [group, text, hover, image, dialog] elif type == "Ansible Playbook": button_class = AnsiblePlaybookButton - args = [group, text, hover, image, playbook_cat_item, inventory, hosts] + args = [group, text, hover, image, playbook_cat_item, inventory] + kwargs['hosts'] = hosts return button_class.from_collection(self, *args, **kwargs) def create( diff --git a/cfme/rest/gen_data.py b/cfme/rest/gen_data.py index be56cea634..95e81aa57c 100644 --- a/cfme/rest/gen_data.py +++ b/cfme/rest/gen_data.py @@ -368,7 +368,7 @@ def automation_requests_data(vm, requests_collection=False, approve=True, num=4) return [data for _ in range(num)] -def groups(request, appliance, role, tenant, num=1, **kwargs): +def groups(request, appliance, role, num=1, **kwargs): tenant = kwargs.pop("tenant", appliance.rest_api.collections.tenants.get(name="My Company")) if num > 1 and kwargs: raise Exception("kwargs cannot be used when num is more than 1") diff --git a/cfme/storage/volume.py b/cfme/storage/volume.py index 17b8a26804..72ec67e82a 100644 --- a/cfme/storage/volume.py +++ b/cfme/storage/volume.py @@ -476,7 +476,7 @@ def create(self, name, provider, tenant=None, volume_type=None, volume_size=1, Args: name: volume name - storage_manager: storage manager name + from_manager: create on the storage manager tenant: tenant name volume_size: volume size in GB provider: provider diff --git a/cfme/tests/ansible/test_embedded_ansible_automate.py b/cfme/tests/ansible/test_embedded_ansible_automate.py index 93a3c733b6..3e5b77b842 100644 --- a/cfme/tests/ansible/test_embedded_ansible_automate.py +++ b/cfme/tests/ansible/test_embedded_ansible_automate.py @@ -5,6 +5,7 @@ from cfme import test_requirements from cfme.automate.simulation import simulate from cfme.control.explorer import alert_profiles +from cfme.exceptions import ItemNotFound from cfme.infrastructure.provider.virtualcenter import VMwareProvider from cfme.markers.env_markers.provider import ONE_PER_TYPE from cfme.services.myservice import MyService @@ -200,8 +201,11 @@ def service_request(appliance, ansible_catalog_item): def service(appliance, ansible_catalog_item): _service = MyService(appliance, ansible_catalog_item.name) yield _service - - _service.delete_if_exists() + try: + if _service.exists: + _service.delete() + except ItemNotFound: + pass @pytest.fixture diff --git a/cfme/tests/storage/test_volume_backup.py b/cfme/tests/storage/test_volume_backup.py index e81b3769d3..49e2519425 100644 --- a/cfme/tests/storage/test_volume_backup.py +++ b/cfme/tests/storage/test_volume_backup.py @@ -22,14 +22,11 @@ @pytest.fixture(scope='module') def backup(appliance, provider): volume_collection = appliance.collections.volumes - storage_manager = '{} Cinder Manager'.format(provider.name) backup_collection = appliance.collections.volume_backups.filter({'provider': provider}) - # create new volume volume = volume_collection.create(name=fauxfactory.gen_alpha(), - storage_manager=storage_manager, tenant=provider.data['provisioning']['cloud_tenant'], - size=STORAGE_SIZE, + volume_size=STORAGE_SIZE, provider=provider) # create new backup for crated volume