cfme.infrastructure.host module

A model of an Infrastructure Host in CFME

var page:A cfme.web_ui.Region object describing common elements on the Providers pages.
var properties_form:
 A cfme.web_ui.Form object describing the main add form.
var credentials_form:
 A cfme.web_ui.Form object describing the credentials form.
class cfme.infrastructure.host.Host(name=None, hostname=None, ip_address=None, custom_ident=None, host_platform=None, ipmi_address=None, mac_address=None, credentials=None, ipmi_credentials=None, interface_type='lan')[source]

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

Model of an infrastructure host in cfme.

Parameters:
  • name – Name of the host.
  • hostname – Hostname of the host.
  • ip_address – The IP address as a string.
  • custom_ident – The custom identifiter.
  • host_platform – Included but appears unused in CFME at the moment.
  • ipmi_address – The IPMI address.
  • mac_address – The mac address of the system.
  • credentials (Credential) – see Credential inner class.
  • ipmi_credentials (Credential) – see Credential inner class.

Usage:

myhost = Host(name='vmware',
              credentials=Provider.Credential(principal='admin', secret='foobar'))
myhost.create()
class Credential(**kwargs)[source]

Bases: cfme.Credential, utils.update.Updateable

Provider credentials

Parameters:**kwargs – If using IPMI type credential, ipmi = True
Host.assign_policy_profiles(*policy_profile_names)[source]

Assign Policy Profiles to this Host.

Parameters:policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
Host.create(cancel=False, validate_credentials=False)[source]

Creates a host in the UI

Parameters:
  • cancel (boolean) – Whether to cancel out of the creation. The cancel is done after all the information present in the Host has been filled in the UI.
  • validate_credentials (boolean) – Whether to validate credentials - if True and the credentials are invalid, an error will be raised.
Host.delete(cancel=True)[source]

Deletes a host from CFME

Parameters:cancel – Whether to cancel the deletion, defaults to True
Host.equal_drift_results(row_text, section, *indexes)[source]

Compares drift analysis results of a row specified by it’s title text

Parameters:
  • row_text – Title text of the row to compare
  • section – Accordion section where the change happened; this section must be activated
  • indexes – Indexes of results to compare starting with 0 for first row (latest result). Compares all available drifts, if left empty (default).

Note

There have to be at least 2 drift results available for this to work.

Returns:True if equal, False otherwise.
Host.execute_button(button_group, button, cancel=True)[source]
Host.exists[source]
Host.get_datastores()[source]

Gets list of all datastores used by this host

Host.get_db_id[source]
Host.get_detail(*ident)[source]

Gets details from the details infoblock

The function first ensures that we are on the detail page for the specific host.

Parameters:*ident – An InfoBlock title, followed by the Key name, e.g. “Relationships”, “Images”

Returns: A string representing the contents of the InfoBlock’s value.

Host.get_ipmi()[source]
Host.has_valid_credentials[source]

Check if host has valid credentials saved

Returns: True if credentials are saved and valid; False otherwise

Host.power_off()[source]
Host.power_on()[source]
Host.pretty_attrs = ['name', 'hostname', 'ip_address', 'custom_ident']
Host.run_smartstate_analysis()[source]

Runs smartstate analysis on this host

Note

The host must have valid credentials already set up for this to work.

Host.tag(tag, **kwargs)[source]

Tags the system by given tag

Host.unassign_policy_profiles(*policy_profile_names)[source]

Unssign Policy Profiles to this Host.

Parameters:policy_profile_namesstr with Policy Profile names. After Control/Explorer coverage goes in, PolicyProfile objects will be also passable.
Host.untag(tag)[source]

Removes the selected tag off the system

Host.update(updates, cancel=False, validate_credentials=False)[source]

Updates a host in the UI. Better to use utils.update.update context manager than call this directly.

Parameters:
  • updates (dict) – fields that are changing.
  • cancel (boolean) – whether to cancel out of the update.
cfme.infrastructure.host.find_quadicon(host, do_not_navigate=False)[source]

Find and return a quadicon belonging to a specific host

Parameters:host – Host name as displayed at the quadicon

Returns: cfme.web_ui.Quadicon instance

cfme.infrastructure.host.get_all_hosts(do_not_navigate=False)[source]

Returns list of all hosts

cfme.infrastructure.host.get_credentials_from_config(credential_config_name)[source]
cfme.infrastructure.host.get_from_config(provider_config_name)[source]

Creates a Host object given a yaml entry in cfme_data.

Usage:

get_from_config('esx')

Returns: A Host object that has methods that operate on CFME

cfme.infrastructure.host.wait_for_a_host()[source]
cfme.infrastructure.host.wait_for_host_delete(host)[source]
cfme.infrastructure.host.wait_for_host_to_appear(host)[source]