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 #8175 from izapolsk/floating_ip_fix
Browse files Browse the repository at this point in the history
[1LP][RFR] fix bug in floating ip Details step
  • Loading branch information
izapolsk committed Nov 21, 2018
2 parents a6790db + e2109d8 commit 33e27ee
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions cfme/networks/floating_ips.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
@attr.s
class FloatingIp(Taggable, BaseEntity):
"""Class representing floating ips"""
address = attr.ib()

in_version = ('5.8', version.LATEST)
category = "networks"
page_name = 'floating_ip'
Expand All @@ -21,8 +23,6 @@ class FloatingIp(Taggable, BaseEntity):
quad_name = None
db_types = ["FloatingIP"]

address = attr.ib()

@property
def status(self):
view = navigate_to(self, 'Details')
Expand All @@ -39,7 +39,6 @@ class FloatingIpCollection(BaseCollection):
""" Collection object for NetworkPort object
Note: Network providers object are not implemented in mgmt
"""

ENTITY = FloatingIp

def all(self):
Expand Down Expand Up @@ -71,25 +70,8 @@ class Details(CFMENavigateStep):
VIEW = FloatingIpDetailsView

def step(self):
# as for 5.9 floating ip doesn't have name att, will get id for navigation
# for 5.8 floating ip table view doesn't have name to search for,
# in this case we will use address
if self.obj.appliance.version < '5.9':
try:
element = self.prerequisite_view.entities.get_entity(
name=self.obj.address, surf_pages=True)
except ItemNotFound:
element = self.prerequisite_view.entities.get_entity(
address=self.obj.address, surf_pages=True)
else:
all_items = self.prerequisite_view.entities.get_all(surf_pages=True)
for entity in all_items:
if entity.data['address'] == self.obj.address:
entity_id = entity.data['id']
element = self.prerequisite_view.entities.get_entity(
entity_id=entity_id, surf_pages=True)
break
try:
element.click()
self.prerequisite_view.entities.get_entity(address=self.obj.address,
surf_pages=True).click()
except Exception:
raise ItemNotFound('Floating IP not found on the page')

0 comments on commit 33e27ee

Please sign in to comment.