cfme.utils.update module

class cfme.utils.update.Updateable[source]

Bases: object

A mixin that helps make an object easily updateable. Two Updateables are equal if all their public fields are equal.

cfme.utils.update.all_public_fields_equal(a, b)[source]
cfme.utils.update.public_fields(o)[source]

Returns: a dict of fields whose name don’t start with underscore.

cfme.utils.update.update(*args, **kwds)[source]

Update an object and then sync it with an external application.

It will copy the object into whatever is named in the ‘as’ clause, run the ‘with’ code block (which presumably alters the object). Then the update() method on the original object will be called with a dict containing only changed fields, and kwargs passed to this function.

If an exception is thrown by update(), the original object will be restored, otherwise the updated object will be returned.

Usage:

with update(myrecord):
   myrecord.lastname = 'Smith'
cfme.utils.update.updates(old, new)[source]

Return a dict of fields that are different between old and new.