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 #8286 from mshriver/fix-typeError
Browse files Browse the repository at this point in the history
[1LP][RFR] Fix instantiation of server in ServerCollection.all()
  • Loading branch information
izapolsk committed Dec 18, 2018
2 parents 2855fb0 + 15ab804 commit b0b4ed5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cfme/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def name(self):
"""
collect = self.appliance.rest_api.collections.servers
servers = collect.all if self.appliance.is_dev else collect.find_by(is_master=True)
return getattr(servers[0], 'name', None)
return getattr(servers[0], 'name', '') # empty string default for string building w/o None

@property
def settings(self):
Expand Down Expand Up @@ -124,7 +124,7 @@ def all(self):
continue
if slave_only and server.is_master:
continue
servers.append(self.instantiate(name=server.name, sid=server.id))
servers.append(self.instantiate(sid=server.id))
# TODO: This code needs a refactor once the attributes can be loaded from the collection
return servers

Expand Down
6 changes: 4 additions & 2 deletions cfme/base/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,16 @@ class Details(CFMENavigateStep):
prerequisite = NavigateToSibling('Configuration')

def step(self):
self.prerequisite_view.accordions.settings.tree.click_path(
path = (
self.obj.zone.region.settings_string,
"Zones",
"Zone: {} (current)".format(self.obj.appliance.server.zone.description),
"Server: {name} [{sid}]{current}".format(
name=self.obj.appliance.server.name,
sid=self.obj.sid,
current='' if self.obj in self.obj.slave_servers else ' (current)'))
current='' if self.obj in self.obj.slave_servers else ' (current)')
)
self.prerequisite_view.accordions.settings.tree.click_path(*path)


@navigator.register(Server, 'Server')
Expand Down
8 changes: 6 additions & 2 deletions cfme/tests/cloud/test_cloud_timelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ def new_instance(appliance, provider):
def mark_vm_as_appliance(new_instance, appliance):
# set diagnostics vm
relations_view = navigate_to(new_instance, 'EditManagementEngineRelationship', wait_for_view=0)
server_name = "{name} ({sid})".format(name=appliance.server.name, sid=appliance.server.sid)
relations_view.form.server.select_by_visible_text(server_name)
relations_view.form.server.select_by_visible_text(
"{name} ({sid})".format(
name=appliance.server.name,
sid=appliance.server.sid
)
)
relations_view.form.save_button.click()


Expand Down

0 comments on commit b0b4ed5

Please sign in to comment.