cfme.services.requests module

cfme.services.requests.approve(reason, cancel=False)[source]

Approve currently opened request

Parameters:
  • reason – Reason for approving the request.
  • cancel – Whether to cancel the approval.
cfme.services.requests.approve_request(cells, reason, cancel=False)[source]

Open the specified request and approve it.

Parameters:
  • cells – Search data for the requests table.
  • reason – Reason for approving the request.
  • cancel – Whether to cancel the approval.
Raises:

RequestExceptioncfme.exceptions.RequestException if the request was not found

cfme.services.requests.copy_request(*args, **kwds)[source]

Context manager that opens the request for editing and saves or cancels depending on success.

Parameters:cells – Search data for the requests table.
cfme.services.requests.debug_requests()[source]
cfme.services.requests.delete(cancel=False)[source]

Delete currently opened request

Parameters:cancel – Whether to cancel the deletion.
cfme.services.requests.delete_request(cells, cancel=False)[source]

Open the specified request and delete it.

Parameters:
  • cells – Search data for the requests table.
  • cancel – Whether to cancel the deletion.
Raises:

RequestExceptioncfme.exceptions.RequestException if the request was not found

cfme.services.requests.deny(reason, cancel=False)[source]

Deny currently opened request

Parameters:
  • reason – Reason for denying the request.
  • cancel – Whether to cancel the denial.
cfme.services.requests.deny_request(cells, reason, cancel=False)[source]

Open the specified request and deny it.

Parameters:
  • cells – Search data for the requests table.
  • reason – Reason for denying the request.
  • cancel – Whether to cancel the denial.
Raises:

RequestExceptioncfme.exceptions.RequestException if the request was not found

cfme.services.requests.edit_request(*args, **kwds)[source]

Context manager that opens the request for editing and saves or cancels depending on success.

Parameters:cells – Search data for the requests table.
cfme.services.requests.go_to_request(cells)[source]

Finds the request and opens the page

See wait_for_request() for futher details.

Parameters:cells – Search data for the requests table.

Returns: Success of the action.

cfme.services.requests.reload()[source]
cfme.services.requests.wait_for_request(cells, partial_check=False)[source]

helper function checks if a request is complete

After finding the request’s row using the cells argument, this will wait for a request to reach the ‘Finished’ state and return it. In the event of an ‘Error’ state, it will raise an AssertionError, for use with pytest.raises, if desired.

Parameters:cells – A dict of cells use to identify the request row to inspect in the request_list Table. See cfme.web_ui.Table.find_rows_by_cells() for more.

Usage:

# Filter on the "Description" column
description = 'Provision from [%s] to [%s]' % (template_name, vm_name)
cells = {'Description': description}

# Filter on the "Request ID" column
# Text must match exactly, you can use "{:,}".format(request_id) to add commas if needed.
request_id = '{:,}'.format(1000000000001)  # Becomes '1,000,000,000,001', as in the table
cells = {'Request ID': request_id}

# However you construct the cells dict, pass it to wait_for_request
# Provisioning requests often take more than 5 minutes but less than 10.
wait_for(wait_for_request, [cells], num_sec=600)
Raises:
  • AssertionError – if the matched request has status ‘Error’
  • RequestException – if multiple matching requests were found
Returns:

The matching cfme.web_ui.Table.Row if found, False otherwise.