diff

Diff module.

class homer.diff.DiffStore[source]

Bases: object

Singleton class to store the device configuration diffs approved or rejected for all devices.

Class creator method, ensure that only one instance is instantiated.

Returns:

the diff store instance.

approve(diff: str) None[source]

Approve a diff for all devices having the same diff.

Parameters:

diff (str) -- the approved diff.

Raises:

homer.exceptions.HomerDiffError -- if the diff is already in the store with a different status.

Return type:

None

reject(diff: str) None[source]

Reject a diff for all devices having the same diff.

Parameters:

diff (str) -- the rejected diff.

Raises:

homer.exceptions.HomerDiffError -- if the diff is already in the store with a different status.

Return type:

None

classmethod reset() None[source]

Reset the DiffStore to its original state erasing all the data.

Return type:

None

status(diff: str) bool | None[source]

Get the diff status, if present in the store.

Returns:

if the diff is not present at all in the store, not approved nor rejected. True: if the diff is approved. False: if the diff is rejected.

Return type:

None