cfme.common package

Module contents

class cfme.common.EditTagsFromDetails(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of TagPageView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.common.EditTagsFromListCollection(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of TagPageView

prerequisite()[source]
step(*args)[source]

args: pass an entities objects or entities names Return: navigation step

class cfme.common.ManagePolicies(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of ManagePoliciesView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.common.ManagePoliciesFromDetails(obj, navigate_obj)[source]

Bases: cfme.utils.appliance.implementations.ui.CFMENavigateStep

VIEW

alias of ManagePoliciesView

prerequisite

This is a helper descriptor for navigation destinations which are linked to the same class.

For instance, imagine you have an object that has a ‘ViewAll’, destination that needs to be visited before you can click on ‘New’. In this instance, you would need to make the ‘New’ destination use ‘ViewAll’ as a prerequisite. As this would need no other special input, we can use NavigateToSibling as a helper. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.common.ManagePoliciesView(*args, **kwargs)[source]

Bases: cfme.base.login.BaseLoggedInPage

Manage policies page

breadcrumb

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

cancel

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

entities

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed
policy_profiles

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

reset

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

save

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.common.PolicyProfileAssignable[source]

Bases: object

This class can be inherited by anything that provider load_details method.

It provides functionality to assign and unassign Policy Profiles

assign_policy_profiles(*policy_profile_names)[source]

Assign Policy Profiles to this object.

Parameters:policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
assign_policy_profiles_multiple_entities(entities, conditions, *policy_profile_names)[source]

Assign Policy Profiles to selected entity’s on Collection All view

Parameters:
  • entities – list of entity’s from collection table
  • policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
  • conditions – entities should match to

Usage:

.. code-block:: python

    collection = appliance.collections.container_images
    # assign OpenSCAP policy
    collection.assign_policy_profiles_multiple_entities(random_image_instances,
                    conditions=[{'name': 'dotnet/dotnet-20-rhel7'},
                                {'name': 'dotnet/dotnet-20-runtime-rhel7'}],
                    'OpenSCAP profile')
assigned_policy_profiles
unassign_policy_profiles(*policy_profile_names)[source]

Unssign Policy Profiles to this object.

Parameters:policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
unassign_policy_profiles_multiple_entities(entities, conditions, *policy_profile_names)[source]

UnAssign Policy Profiles to selected entity’s on Collection All view

Parameters:
  • entities – list of entity’s from collection table
  • policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
  • conditions – entities should match to

Usage:

.. code-block:: python

    collection = appliance.collections.container_images
    # unassign OpenSCAP policy
    collection.unassign_policy_profiles_multiple_entities(random_image_instances,
                    conditions=[{'name': 'dotnet/dotnet-20-rhel7'},
                                {'name': 'dotnet/dotnet-20-runtime-rhel7'}],
                    'OpenSCAP profile')
class cfme.common.TagPageView(*args, **kwargs)[source]

Bases: cfme.base.login.BaseLoggedInPage

Class represents common tag page in CFME UI

form

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

is_displayed
table_title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

title

This class handles instantiating and caching of the widgets on view.

It stores the class and the parameters it should be instantiated with. Once it is accessed from the instance of the class where it was defined on, it passes the instance to the widget class followed by args and then kwargs.

It also acts as a counter, so you can then order the widgets by their “creation” stamp.

class cfme.common.Taggable[source]

Bases: object

This class can be inherited by any class that honors tagging. Class should have following

  • ‘Details’ navigation
  • ‘Details’ view should have entities.smart_management SummaryTable widget
  • ‘EditTags’ navigation
  • ‘EditTags’ view should have nested ‘form’ view with ‘tags’ table widget
  • Suggest using class cfme.common.TagPageView as view for ‘EditTags’ nav

This class provides functionality to assign and unassigned tags for page models with standardized widgetastic views

add_tag(tag=None, cancel=False, reset=False, details=True)[source]

Add tag to tested item

Parameters:
  • tag – Tag object
  • cancel – set True to cancel tag assigment
  • reset – set True to reset already set up tag
  • details (bool) – set False if tag should be added for list selection, default is details page
add_tags(tags)[source]

Add multiple tags

Parameters:tags – list of tag objects
get_tags(tenant='My Company Tags')[source]

Get list of tags assigned to item.

Details entities should have smart_management widget For vm, providers, and other like pages ‘SummaryTable’ widget should be used, for user, group like pages(no tables on details page) use ‘SummaryForm’

Parameters:tenant – string, tags tenant, default is “My Company Tags”

Returns: list List of Tag objects

remove_tag(tag, cancel=False, reset=False, details=True)[source]

Remove tag of tested item

Parameters:
  • tag – Tag object
  • cancel – set True to cancel tag deletion
  • reset – set True to reset tag changes
  • details (bool) – set False if tag should be added for list selection, default is details page
remove_tags(tags)[source]

Remove multiple of tags

Parameters:tags – list of tag objects
class cfme.common.TopologyMixin[source]

Bases: object

Use this mixin to have simple access to the Topology page. To use this TopologyMixin you have to implement load_topology_page function, which should take to topology page

Sample usage:

# You can retrieve the elements details as it is in the UI
topology.elements  # => 'hostname'
# You can do actions on topology page
topology.display_names.enable()
topology.display_names.disable()
topology.display_names.is_enabled
# You can do actions on topology search box
topology.search_box.text(text='hello')
topology.search_box.text(text='hello', submit=False)
topology.search_box.submit()
topology.search_box.clear()
# You can get legends and can perform actions
topology.legends
topology.pod.name
topology.pod.is_active
topology.pod.set_active()
# You can get elements, element parents and children
topology.elements
topology.elements[0].parents
topology.elements[0].children
topology.elements[0].double_click()
topology.elements[0].is_displayed()
class cfme.common.UtilizationMixin[source]

Bases: object

Use this mixin to have simple access to the Utilization information of an object.

Requires that the class(page) has load_details(refresh) method and taggable_type should be defined.

All the chart names from the UI are “attributized”.

Sample usage: .. code-block:: python

# You can list available charts page.utilization.charts # => ‘[ ‘jvm_heap_usage_bytes’,’web_sessions’,’transactions’]’ # You can get the data from chart page.utilization.jvm_heap_usage_bytes.list_data_chart() # => returns data as list # You can get the data from table provider.utilization.jvm_heap_usage_bytes.list_data_table() # => returns data as list # You can get the data from wrapanapi page.utilization.jvm_heap_usage_bytes.list_data_mgmt() # => returns data as list # You can change chart option page.utilization.jvm_non_heap_usage_bytes.option.set_by_visible_text(op_interval=’Daily’) # You can list available ledgends page.utilization.jvm_non_heap_usage_bytes.legends # You can enable/disable legends page.utilization.jvm_non_heap_usage_bytes.committed.set_active(active=False) # => Disables page.utilization.jvm_non_heap_usage_bytes.committed.set_active(active=True) # => Enables
class cfme.common.Validatable[source]

Bases: object

Mixin for various validations. Requires the class to be also Taggable.

:var property_tuples: Tuples which first value is the provider class’s attribute
name, the second value is provider’s UI summary page field key. Should have values in child classes.
property_tuples = []
validate_properties()[source]

Validation method which checks whether class attributes, which were used during creation of provider, are correctly displayed in Properties section of provider UI.

The maps between class attribute and UI property is done via ‘property_tuples’ variable.

Fails if some property does not match.

validate_tags(reference_tags)[source]

Validation method which check tagging between UI and provided reference_tags.

To use this method, self/caller should be extended with Taggable class

Parameters:reference_tags – If you want to compare user input with UI, pass user input as reference_tags