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

Commit

Permalink
Merge pull request #6046 from quarckster/fix_automate_method
Browse files Browse the repository at this point in the history
[RFR] Fixed tree_path in Automate/Method class
  • Loading branch information
mshriver authored Dec 5, 2017
2 parents 482e193 + ddd9122 commit 760735a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions cfme/automate/explorer/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from cached_property import cached_property
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic.utils import ParametrizedLocator, VersionPick
from widgetastic.utils import ParametrizedLocator
from widgetastic.widget import Table, Text, View
from widgetastic_manageiq import SummaryFormItem, ScriptBox, Input
from widgetastic_patternfly import BootstrapSelect, BootstrapSwitch, Button, CandidateNotFound
Expand Down Expand Up @@ -209,10 +209,6 @@ def is_displayed(self):


class Method(BaseEntity, Copiable):
ICON_NAME = VersionPick({
Version.lowest(): 'product-method',
'5.9': 'fa-ruby',
})

def __init__(self, collection, name=None, display_name=None, location='inline', script=None,
data=None, repository=None, playbook=None, machine_credential=None, hosts=None,
Expand Down Expand Up @@ -274,11 +270,15 @@ 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'}
if self.display_name:
return self.parent_obj.tree_path + [
(self.ICON_NAME, '{} ({})'.format(self.display_name, self.name))]
(icon_name_map[self.location], '{} ({})'.format(self.display_name, self.name))]
else:
return self.parent_obj.tree_path + [(self.ICON_NAME, self.name)]
return self.parent_obj.tree_path + [(icon_name_map[self.location], self.name)]

@property
def tree_path_name_only(self):
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ webencodings==0.5.1
websocket-client==0.40.0
Werkzeug==0.12.2
widgetastic.core==0.13.0
widgetastic.patternfly==0.0.23
widgetastic.patternfly==0.0.24
widgetsnbextension==2.0.0
wrapanapi==2.4.6
wrapt==1.10.10
Expand Down

0 comments on commit 760735a

Please sign in to comment.