cfme.infrastructure.config_management module

class cfme.infrastructure.config_management.AnsibleTower(name=None, url=None, ssl=None, credentials=None, key=None)[source]

Bases: cfme.infrastructure.config_management.ConfigManager

Configuration manager object (Ansible Tower)

Parameters:
  • name – Name of the Ansible Tower configuration manager
  • url – URL, hostname or IP of the configuration manager
  • ssl – Boolean value; True if SSL certificate validity should be checked, False otherwise
  • credentials – Credentials to access the config. manager
  • key – Key to access the cfme_data yaml data (same as name if not specified)

Usage:

Create provider:
.. code-block:: python

    tower_cfg_mgr = AnsibleTower('my_tower', 'https://my-tower.example.com/api/v1',
                        ssl=False, ConfigManager.Credential(principal='admin',
                        secret='testing'), key='tower_yaml_key')
    tower_cfg_mgr.create()

Update provider:
.. code-block:: python

    with update(tower_cfg_mgr):
        tower_cfg_mgr.name = 'new_tower_name'

Delete provider:
.. code-block:: python

    tower_cfg_mgr.delete()
type = 'Ansible Tower'
class cfme.infrastructure.config_management.ConfigManager(name=None, url=None, ssl=None, credentials=None, key=None, appliance=None)[source]

Bases: utils.update.Updateable, utils.pretty.Pretty, utils.appliance.Navigatable

This is base class for Configuration manager objects (Red Hat Satellite, Foreman, Ansible Tower)

Parameters:
  • name – Name of the config. manager
  • url – URL, hostname or IP of the config. manager
  • ssl – Boolean value; True if SSL certificate validity should be checked, False otherwise
  • credentials – Credentials to access the config. manager
  • key – Key to access the cfme_data yaml data (same as name if not specified)

Usage:

Use Satellite or AnsibleTower classes instead.
class Credential(principal, secret, verify_secret=None, domain=None, **ignore)[source]

Bases: cfme.base.credential.Credential, utils.update.Updateable

ConfigManager.config_profiles

Returns ‘ConfigProfile’ configuration profiles (hostgroups) available on this manager

ConfigManager.create(cancel=False, validate_credentials=True, validate=True, force=False)[source]

Creates the manager through UI

Parameters:
  • cancel (bool) – Whether to cancel out of the creation. The cancel is done after all the information present in the manager has been filled in the UI.
  • validate_credentials (bool) – Whether to validate credentials - if True and the credentials are invalid, an error will be raised.
  • validate (bool) – Whether we want to wait for the manager’s data to load and show up in it’s detail page. True will also wait, False will only set it up.
  • force (bool) – Whether to force the creation even if the manager already exists. True will try anyway; False will check for its existence and leave, if present.
ConfigManager.delete(cancel=False, wait_deleted=True, force=False)[source]

Deletes the manager through UI

Parameters:
  • cancel (bool) – Whether to cancel out of the deletion, when the alert pops up.
  • wait_deleted (bool) – Whether we want to wait for the manager to disappear from the UI. True will wait; False will only delete it and move on.
  • force (bool) – Whether to try to delete the manager even though it doesn’t exist. True will try to delete it anyway; False will check for its existence and leave, if not present.
ConfigManager.exists

Returns whether the manager exists in the UI or not

classmethod ConfigManager.load_from_yaml(key)[source]

Returns ‘ConfigManager’ object loaded from yamls, based on its key

ConfigManager.pretty_attr = ['name', 'url']
ConfigManager.quad_name
ConfigManager.refresh_relationships(cancel=False)[source]

Refreshes relationships and power states of this manager

ConfigManager.systems

Returns ‘ConfigSystem’ configured systems (hosts) available on this manager

ConfigManager.type = None
ConfigManager.update(updates, cancel=False, validate_credentials=False)[source]

Updates the manager through UI

Parameters:
  • updates (dict) – Data to change.
  • cancel (bool) – Whether to cancel out of the update. The cancel is done after all the new information has been filled in the UI.
  • validate_credentials (bool) – Whether to validate credentials - if True and the credentials are invalid, an error will be raised.

Note

utils.update use is recommended over use of this method.

ConfigManager.yaml_data

Returns yaml data for this manager

class cfme.infrastructure.config_management.ConfigProfile(name, manager, appliance=None)[source]

Bases: utils.pretty.Pretty, utils.appliance.Navigatable

Configuration profile object (foreman-side hostgroup)

Parameters:
  • name – Name of the profile
  • manager – ConfigManager object which this profile is bound to
pretty_attrs = ['name', 'manager']
systems

Returns ‘ConfigSystem’ objects that are active under this profile

class cfme.infrastructure.config_management.ConfigSystem(name, profile, appliance=None)[source]

Bases: utils.pretty.Pretty, utils.appliance.Navigatable

pretty_attrs = ['name', 'manager_key']
tag(tag)[source]

Tags the system by given tag

tags

Returns a list of this system’s active tags

untag(tag)[source]

Removes the selected tag off the system

class cfme.infrastructure.config_management.Details(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

prerequisite

This is a helper descriptor for destinations which are linked to an attribute of the object.

For instance, imagine you have an object that has an attribute(parent) which 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 NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.

step()[source]
class cfme.infrastructure.config_management.MgrAdd(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

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.infrastructure.config_management.MgrAll(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

am_i_here()[source]
prerequisite

This is a helper descriptor for destinations which are linked to an attribute of the object.

For instance, imagine you have an object that has an attribute(parent) which 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 NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.

resetter()[source]
step()[source]
class cfme.infrastructure.config_management.MgrDetails(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

am_i_here()[source]
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.infrastructure.config_management.MgrEdit(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

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.infrastructure.config_management.MgrEditFromDetails(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

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.infrastructure.config_management.Satellite(name=None, url=None, ssl=None, credentials=None, key=None)[source]

Bases: cfme.infrastructure.config_management.ConfigManager

Configuration manager object (Red Hat Satellite, Foreman)

Parameters:
  • name – Name of the Satellite/Foreman configuration manager
  • url – URL, hostname or IP of the configuration manager
  • ssl – Boolean value; True if SSL certificate validity should be checked, False otherwise
  • credentials – Credentials to access the config. manager
  • key – Key to access the cfme_data yaml data (same as name if not specified)

Usage:

Create provider:
.. code-block:: python

    satellite_cfg_mgr = Satellite('my_satellite', 'my-satellite.example.com',
                        ssl=False, ConfigManager.Credential(principal='admin',
                        secret='testing'), key='satellite_yaml_key')
    satellite_cfg_mgr.create()

Update provider:
.. code-block:: python

    with update(satellite_cfg_mgr):
        satellite_cfg_mgr.name = 'new_satellite_name'

Delete provider:
.. code-block:: python

    satellite_cfg_mgr.delete()
type

Returns presumed type of the manager based on CFME version

Note

We cannot actually know the type of the provider from the UI. This represents the supported type by CFME version and is to be used in navigation.

class cfme.infrastructure.config_management.SysAll(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

am_i_here()[source]
prerequisite

This is a helper descriptor for destinations which are linked to an attribute of the object.

For instance, imagine you have an object that has an attribute(parent) which 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 NavigateToAttribute as a helper, supplying only the name of the attribute which stores the object to be used in the navigation, and the destination name. This will set prerequisite to be a callable that will navigate to the prerequisite step.

resetter()[source]
step()[source]
class cfme.infrastructure.config_management.SysEditTags(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

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.infrastructure.config_management.SysProvision(obj, navigate_obj)[source]

Bases: utils.appliance.implementations.ui.CFMENavigateStep

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]
cfme.infrastructure.config_management.cfm_mgr_table()[source]
cfme.infrastructure.config_management.get_config_manager_from_config(cfg_mgr_key)[source]