Package syspolicy :: Package modules :: Module state :: Class State
[hide private]
[frames] | no frames]

Class State

source code

module.Module --+
                |
               State

This module provides internal policy state management for SysPolicy

Instance Methods [hide private]
 
__init__(self) source code
 
cs_check_diff(self, policy, operation, path, value, diff)
This function produces a ChangeSet based on the changed policy attribute.
source code
 
set_state(self, change)
This function implements a set_state Change operation, simply storing the new value in the policy state file.
source code

Inherited from module.Module: append_lines_to_file, cs_new_attribute, cs_rem_attribute, cs_set_attribute, cs_set_default, edit_configfile, execute, perform_change

Class Variables [hide private]

Inherited from module.Module: change_operations, diff_operations, event_hooks, handled_attributes, name, pt

Method Details [hide private]

__init__(self)
(Constructor)

source code 
Overrides: module.Module.__init__

cs_check_diff(self, policy, operation, path, value, diff)

source code 

This function produces a ChangeSet based on the changed policy attribute. The Change element will be executed by the set_state function.

Parameters:
  • policy - Policy in which the difference was detected
  • operation - type of the difference
  • path - Location of the difference in the tree
  • value - The new value that was set (None when it was removed)
  • diff - The difference from the old value
Returns:
This function always returns a ChangeSet
Overrides: module.Module.cs_check_diff

set_state(self, change)

source code 

This function implements a set_state Change operation, simply storing the new value in the policy state file.

Parameters:
  • change - Change element
Returns:
STATE_COMPLETED or STATE_FAILED