Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #8675 from mshriver/remove-59z-refs
Browse files Browse the repository at this point in the history
[1LP][RFR] Remove 59z refs
  • Loading branch information
izapolsk authored Apr 9, 2019
2 parents 9f0f017 + 4fbc3f9 commit af5e08f
Show file tree
Hide file tree
Showing 163 changed files with 853 additions and 2,077 deletions.
7 changes: 2 additions & 5 deletions cfme/ansible/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,8 @@ def update(self, updates):

def delete(self):
view = navigate_to(self, "Details")
if self.appliance.version < "5.9":
remove_str = "Remove this Credential"
else:
remove_str = "Remove this Credential from Inventory"
view.toolbar.configuration.item_select(remove_str, handle_alert=True)
view.toolbar.configuration.item_select("Remove this Credential from Inventory",
handle_alert=True)
credentials_list_page = self.create_view(CredentialsListView)
wait_for(lambda: False, silent_failure=True, timeout=5)
assert credentials_list_page.is_displayed
Expand Down
21 changes: 6 additions & 15 deletions cfme/ansible/repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,8 @@ def update(self, updates):
assert view.is_displayed
view.flash.assert_no_error()
if changed:
if self.appliance.version < "5.9":
msg = 'Edit of Repository "{}" was successfully initialized.'
else:
msg = 'Edit of Repository "{}" was successfully initiated.'
view.flash.assert_message(msg.format(updates.get("name", self.name)))
view.flash.assert_message('Edit of Repository "{}" was successfully initiated.'
.format(updates.get("name", self.name)))

def _wait_until_changes_applied():
changed_updated_at = self.db_object.updated_at
Expand All @@ -177,11 +174,8 @@ def _wait_until_changes_applied():
def delete(self):
"""Delete the repository in the UI."""
view = navigate_to(self, "Details")
if self.appliance.version < "5.9":
remove_str = "Remove this Repository"
else:
remove_str = "Remove this Repository from Inventory"
view.toolbar.configuration.item_select(remove_str, handle_alert=True)
view.toolbar.configuration.item_select("Remove this Repository from Inventory",
handle_alert=True)
repo_list_page = self.create_view(RepositoryAllView)
assert repo_list_page.is_displayed
repo_list_page.flash.assert_no_error()
Expand Down Expand Up @@ -239,11 +233,8 @@ def create(self, name, url, description=None, scm_credentials=None, scm_branch=N
repo_list_page = self.create_view(RepositoryAllView)
assert repo_list_page.is_displayed
repo_list_page.flash.assert_no_error()
if self.appliance.version < "5.9.2":
initiated_message = 'Add of Repository "{}" was successfully initialized.'.format(name)
else:
initiated_message = 'Add of Repository "{}" was successfully initiated.'.format(name)
repo_list_page.flash.assert_message(initiated_message)
repo_list_page.flash.assert_message('Add of Repository "{}" was successfully initiated.'
.format(name))

repository = self.instantiate(
name,
Expand Down
3 changes: 1 addition & 2 deletions cfme/automate/explorer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def copy_to(self, domain, new_name=None, replace=None, cancel=False):
copy_page.copy_button.click()
# Attention! Now we should be on a different page but the flash message is the same!
copy_page.flash.assert_no_error()
if not BZ(1510463, forced_streams=['5.9']).blocks:
copy_page.flash.assert_message(
copy_page.flash.assert_message(
'Copy selected Automate {} was saved'.format(type(self).__name__))
else:
copy_page.cancel_button.click()
Expand Down
6 changes: 2 additions & 4 deletions cfme/automate/explorer/klass.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,8 @@ def create(self, name=None, display_name=None, description=None, cancel=False):
else:
add_page.add_button.click()
add_page.flash.assert_no_error()
if not BZ(1428424, forced_streams=['5.9']).blocks:
add_page.flash.assert_message(
'Automate Class "/{}/{}" was added'.format(
'/'.join(self.tree_path[1:]), name))
add_page.flash.assert_message('Automate Class "/{}/{}" was added'
.format('/'.join(self.tree_path[1:]), name))
return self.instantiate(name=name, display_name=display_name, description=description)

def delete(self, *classes):
Expand Down
7 changes: 2 additions & 5 deletions cfme/automate/explorer/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,7 @@ def domain(self):

@property
def tree_path(self):
if self.appliance.version < '5.9':
icon_name_map = {'inline': 'product-method'}
else:
icon_name_map = {'inline': 'fa-ruby', 'playbook': 'vendor-ansible'}
icon_name_map = {'inline': 'fa-ruby', 'playbook': 'vendor-ansible'}
if self.display_name:
return self.parent_obj.tree_path + [
(icon_name_map[self.location], '{} ({})'.format(self.display_name, self.name))]
Expand Down Expand Up @@ -467,7 +464,7 @@ def create(
'playbook_input_parameters': playbook_input_parameters
})
validate = False
if validate and not BZ(1499881, forced_streams=['5.9']).blocks:
if validate:
add_page.validate_button.click()
add_page.wait_displayed()
add_page.flash.assert_no_error()
Expand Down
6 changes: 1 addition & 5 deletions cfme/base/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ def change_group(self, group_name):
User is required to be currently logged in
"""
if self.extra.appliance.version < '5.9':
raise CFMEException("Changing the user group is not supported in versions < 5.9")

if not self.logged_in_as_user:
raise CFMEException("Unable to change group when a user is not logged in")

Expand Down Expand Up @@ -87,8 +84,7 @@ def group_names(self):
""" Return a list of the logged in user's assigned groups.
Returns:
Version >= 5.9 - list containing all groups the logged in user is assigned to
Version < 5.9 - single item list containing the user's current group
list containing all groups the logged in user is assigned to
"""

return [
Expand Down
25 changes: 7 additions & 18 deletions cfme/base/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def address(self):
def prepare_server_name(name):
# there is a bug in CF 5.10 UI when it has different number of spaces in different html attrs
# this is temporary workaround until BZ(1668849) is fixed
if BZ(1668849, forced_streams=['5.9', '5.10']).blocks:
if BZ(1668849).blocks:
new_name = re.escape(name)
new_name = new_name.replace(r'\ ', r'\s*')
new_name = re.compile(new_name)
Expand Down Expand Up @@ -1025,8 +1025,6 @@ class advanced(WaitTab): # noqa
company_tags = View.nested(CompanyTags)
import_tags = View.nested(ImportTags)
map_tags = View.nested(MapTags)

# available starting from 5.9 version, not available in 5.7, 5.8
tags = View.nested(TagsView)

@property
Expand Down Expand Up @@ -1097,10 +1095,7 @@ def am_i_here(self):
return False

def step(self, *args, **kwargs):
if self.obj.appliance.version < '5.9':
self.prerequisite_view.import_tags.select()
else:
self.prerequisite_view.tags.import_tags.select()
self.prerequisite_view.tags.import_tags.select()


@navigator.register(Region)
Expand All @@ -1112,10 +1107,7 @@ def am_i_here(self):
return False

def step(self, *args, **kwargs):
if self.obj.appliance.version < '5.9':
self.prerequisite_view.imports.select()
else:
self.prerequisite_view.tags.imports.select()
self.prerequisite_view.tags.imports.select()


@navigator.register(Region)
Expand Down Expand Up @@ -1717,14 +1709,11 @@ class import_git(View): # noqa

@property
def is_displayed(self):
# TODO: Remove check if the fix for BZ 1686054 is back ported to 5.9z
if self.browser.product_version < "5.10":
title = "Reset all components in the following domains: ManageIQ"
else:
title = "Reset all components in the following domains: RedHat, ManageIQ"
title = "Reset all components in the following domains: RedHat, ManageIQ"

return (self.in_import_export and self.export_all.is_displayed and self.reset_title.text
== title)
return (self.in_import_export and
self.export_all.is_displayed and
self.reset_title.text == title)


@navigator.register(Server)
Expand Down
12 changes: 4 additions & 8 deletions cfme/cloud/provider/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,17 @@ class GCEProvider(CloudProvider):
settings_key = 'ems_google'

project = attr.ib(default=None)
region = attr.ib(default=None)
region_name = attr.ib(default=None)
region = attr.ib(default=None) # deprecated in 5.9.2
region_name = attr.ib(default=None) # deprecated in 5.9.2

@property
def view_value_mapping(self):
endpoints = {
'name': self.name,
'prov_type': 'Google Compute Engine',
'region': self.region_name,
'project_id': self.project
}

if self.appliance.version >= '5.9.2':
# from 5.9.2 we are not supporting region selection for GCE
del endpoints['region']
return endpoints

@classmethod
Expand All @@ -70,8 +66,8 @@ def from_config(cls, prov_config, prov_key):
name=prov_config['name'],
project=prov_config['project'],
zone=prov_config['zone'],
region=prov_config['region'],
region_name=prov_config['region_name'],
region=prov_config.get('region'),
region_name=prov_config.get('region_name'),
endpoints={endpoint.name: endpoint},
key=prov_key)

Expand Down
6 changes: 1 addition & 5 deletions cfme/cloud/provider/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ def from_config(cls, prov_config, prov_key):

event_endpoint_config = prov_config['endpoints'].get(EventsEndpoint.name, {})
if event_endpoint_config:
if (event_endpoint_config.get('event_stream') == 'AMQP' and
BZ(1618700, forced_streams=["5.9", "5.10", "upstream"]).blocks):
logger.warning('Skipping AMQP event config due to BZ 1618700')
else:
endpoints[EventsEndpoint.name] = EventsEndpoint(**event_endpoint_config)
endpoints[EventsEndpoint.name] = EventsEndpoint(**event_endpoint_config)

rsa_endpoint_config = prov_config['endpoints'].get(SSHEndpoint.name, {})
if rsa_endpoint_config:
Expand Down
4 changes: 0 additions & 4 deletions cfme/cloud/security_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,4 @@ class Add(CFMENavigateStep):
def step(self, *args, **kwargs):
"""Raises DropdownItemDisabled from widgetastic_patternfly
if no RHOS Network manager present"""
# Todo remove when fixed 1520669
if (BZ(1520669, forced_streams='5.9').blocks and
self.prerequisite_view.flash.messages):
self.prerequisite_view.flash.dismiss()
self.prerequisite_view.toolbar.configuration.item_select('Add a new Security Group')
6 changes: 2 additions & 4 deletions cfme/cloud/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,8 @@ def exists(self):
def delete(self):
"""Delete the stack from detail view"""
view = navigate_to(self, 'Details')
msg = 'Remove this Orchestration Stack'
if self.appliance.version >= '5.9':
msg = 'Remove this Orchestration Stack from Inventory'
view.toolbar.configuration.item_select(msg, handle_alert=True)
view.toolbar.configuration.item_select('Remove this Orchestration Stack from Inventory',
handle_alert=True)
view.flash.assert_success_message('The selected Orchestration Stacks was deleted')

def refresh():
Expand Down
7 changes: 0 additions & 7 deletions cfme/common/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,6 @@ def create(self, cancel=False, validate_credentials=True, check_existing=False,
add_view = navigate_to(self, 'Add')

if not cancel or (cancel and any(self.view_value_mapping.values())):
# Workaround for BZ#1526050
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
if self.appliance.version == '5.8.3.0' and self.one_of(VMwareProvider):
add_view.fill({'prov_type': 'Red Hat Virtualization'})
elif '5.8.3.0' < self.appliance.version < '5.9':
import warnings
warnings.warn('REMOVE ME: BZ#1526050')
# filling main part of dialog
add_view.fill(self.view_value_mapping)

Expand Down
50 changes: 24 additions & 26 deletions cfme/common/provider_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@ def is_displayed(self):
self.title.text == 'Add New Cloud Provider')


class ContainerProviderSettingView(ProvidersView):
class ContainerProviderSettingView(View):
"""
Settings view for builds 5.9 and up
Settings view for Container Providers
"""

@View.nested
Expand All @@ -490,33 +490,28 @@ class advanced(WaitTab, BeforeFillMixin): # NOQA

class ContainerProviderAddView(ProviderAddView):
"""
represents Container Provider Add View
"""
prov_type = BootstrapSelect(id='ems_type')

@property
def is_displayed(self):
return (super(ProviderAddView, self).is_displayed and
self.navigation.currently_selected == ['Compute', 'Containers', 'Providers'] and
self.title.text == 'Add New Containers Provider')


class ContainerProviderAddViewUpdated(ContainerProviderAddView, ContainerProviderSettingView):
"""
Additional widgets for builds 5.9 and up
Additional widgets for Container
"""
COND_WIDGETS = ['prov_type', 'metrics_type', 'alerts_type', 'virt_type']

prov_type = BootstrapSelect(id='ems_type')
metrics_type = BootstrapSelect(id='metrics_selection')
alerts_type = BootstrapSelect(id='alerts_selection')
virt_type = BootstrapSelect(id='virtualization_selection')
included_settings = View.include(ContainerProviderSettingView, use_parent=True)

def before_fill(self, values):
for widget_name in self.COND_WIDGETS:
widget = getattr(self, widget_name)
if widget.is_displayed:
widget.fill(values.get(widget_name) or 'Disabled')

@property
def is_displayed(self):
return (super(ProviderAddView, self).is_displayed and
self.navigation.currently_selected == ['Compute', 'Containers', 'Providers'] and
self.title.text == 'Add New Containers Provider')


class PhysicalProviderAddView(ProviderAddView):
"""
Expand Down Expand Up @@ -547,19 +542,21 @@ class ProviderEditView(ProviderAddView):
@property
def is_displayed(self):
provider_obj = self.context['object']
expected_title = ("Edit {type} Providers '{name}'".format(
type=provider_obj.string_name, name=provider_obj.name))
expected_title = "Edit {type} Providers '{name}'".format(type=provider_obj.string_name,
name=provider_obj.name)

return (self.logged_in_as_current_user and
self.title.text == expected_title and
self.navigation.currently_selected == [
'Compute',
('Clouds' if provider_obj.string_name == "Cloud" else provider_obj.string_name),
'Providers'
])
return (
self.logged_in_as_current_user and
self.title.text == expected_title and
self.navigation.currently_selected == [
'Compute',
('Clouds' if provider_obj.string_name == "Cloud" else provider_obj.string_name),
'Providers'
]
)


class ContainerProviderEditViewUpdated(ProviderEditView, ContainerProviderSettingView):
class ContainerProviderEditView(ProviderEditView):
"""
Additional widgets for builds 5.9 and up
"""
Expand All @@ -569,6 +566,7 @@ class ContainerProviderEditViewUpdated(ProviderEditView, ContainerProviderSettin
metrics_type = BootstrapSelect(id='metrics_selection')
alerts_type = BootstrapSelect(id='alerts_selection')
virt_type = BootstrapSelect(id='virtualization_selection')
included_settings = View.include(ContainerProviderSettingView, use_parent=True)

def before_fill(self, values):
for widget in self.COND_WIDGETS:
Expand Down
Loading

0 comments on commit af5e08f

Please sign in to comment.