Configuration of profile-manager |
modules/ProfileManager.ycp |
| Data for configuration of profile-manager, input and output funcs. | |
|
how many times was progress bar used
Is the module runing for the first time?
Is SCPM enabled?
Was enabled/disabled status changed?
if resource groups were modified
Is SCPM re-initialization needed? (possibly after update)
Is SCPM recovery? (after something failed)
Is SCPM initialized? This is set to true after first enabling.
Is set "close popups automaticaly" check?
This shows if the "autoswitch" was set while adding a new profile.
Map of actual profiles and its descriptions. It is read in ReadProfiles() and ReadProfilesDescription().
- Example
-
$[ "default" : "This is the default", "home" : "My home profile", ... ]
Map of selected profile's settings. It is read in GetProfile() and written in SetProfile().
- Example
-
$[ "name" : "home", "description" : "My home profile", "prestart" : "", "postart" : "/tmp/poststart_script", "prestop" : "", "poststop" : "" ]
This is the name of the active profile. It is read in ReadActiveProfile().
This is the name of the profile selected in some widget.
The list of predefined resource sets.
- Example
-
[ "typical", "network_only" ]
The list of user defined resource sets.
This variable defines the action whis will be done with the profile in the ProfileSettingsDialog. Can be "new", "copy" or "edit".
When scpm action fails, the error message is stored here by SetError()
Abort function return boolean return true if abort
In this map are written the variables close_popups and first_time. It is read from the file in ReadUserSettings() and written to the file in WriteUserSettings().
how many lines of progress has been pruducted
The name of the file, where the progress state is beeing written. (The same name must use the scpm agent!)
The name of the file, where are written the resource changes. This file is checked after pushing "Show changes" button. (The same name must use the scpm agent!)
This map represents the switch_info struct. It is read in PrepareSwitch() and used by Switch().
- Example
-
$[ "profile_name": "home", "profile_modified": true, "modified_resources": [ $[ "resource_name": "/etc/X11/XF86Config", "resource_type": "file", "is_new": false, "is_deleted": true, "save": true ] ] ]
Abort function
- Return value:
-
blah blah lahjk
This function is called when some scpm command failed. The error message is read and shown in Popup::Error.
This function is called when some scpm command failed. The error message is read and stored in global variable scpm_error.
all resource groups available; filled by ReadResourceGroups()
list of resource groups marked for deletion
this map holds the contents of scpm.conf configuration file
helper structure for faster querying modified resource groups (prepared for Switch) - is filled in GetModifiedGroups() function
default value of "save" flags of modified resources (groups) TODO: when is changed?
if module was canceled (aborted)
name of resource group currently beeing edited (selected in SwitchDialog)
Writes modified resource group.
- Parameters:
-
groupname resource group name resources list of resources belonging to this group descr group description
- Return value:
-
success
Gets resources of resource group.
- Parameters:
-
groupname resource group name
- Return value:
-
of resources
Reads all available resource groups.
- Return value:
-
true on success
get the map of default resource groups
Resets RG's to default values
- Return value:
-
success
Resets one resource group to default values
- Parameters:
-
groupname
- Return value:
-
success
Returns all available resource groups.
- Return value:
-
of groups
Can be resource group deleted by user?
- Parameters:
-
groupname name of group
Does given resource group exist? (Checked when user enters name of new group)
- Parameters:
-
groupname name of group
Store error messages generated by multiple commands to one string
- Parameters:
-
error
Save the resource groups edited in YaST UI
- Return value:
-
success
reads a contents of scpm config file (/etc/scpm.conf)
- Return value:
-
false when file doesn't exist
writes configuration data to scpm config file (/etc/scpm.conf)
- Return value:
-
true
gets the modified resources belonging to one group
- Parameters:
-
groupname
- Return value:
-
of format resources_of_modified_group (see GetModifiedGroups())
Uses "switch_info" map to generate helper structure "modified_groups"
- Example
-
modified_groups structure $[ modified_group: resources_of_modified_group ] modified_group is name of resource group resources_of_modified_group is a map of format: $[ 0: $[ "resource_name": "/etc/inetd.conf", "resource_type": "file", "save": true, "save_mode": "normal", "groups": [ $[ "name": "inetd", "description": "Inetd services" ]] ], 1: $[ "resource_name": "xinetd", "resource_type": "service", "save": true, "save_mode": "normal", "groups": [ $[ "name": "inetd", "description": "Inetd services" ]] ], "save" : true, "modified": false, "description" "Inetd services" ] numbers are indexes in the switch_info["modified_resources"]:[] list, "save" and "modified" are flags of this group (modified_group)
Update global flags (save/m) of groups according to the state of their resources
- Parameters:
-
groups list of groups to check and possibly update
Check the modified resources belonging to specified group If user changed anything (in DetailsSwitchDialog), global maps modified_groups and switch_info are updated.
Some of modified resource could be also contained in some other group and all such groups have to be checked also (to update modified_groups).
- Parameters:
-
name group name resources map of that group's modified resources (altered by user)
Sets the "save" flag of all resources belonging to selected resource group to the opposite value. Also sets "save_mode" of each resource to "normal"
- Parameters:
-
groupname resource group name
- Return value:
-
the new value
Creates the item list for the Table widget (to use in Switch dialog).
- Return value:
-
of items
Initialize the SCPM agent.
- Return value:
-
true on success
Checks if SCPM is enabled/disabled/initialized.
- Return value:
-
true on success
Calls SCPM::Recover (false) function, which replays journal after the crash (started in separate agen'ts thread, return value must be checked with Wait)
Calls SCPM::Recover (true)
Reads the list of aviable resource sets.
- Return value:
-
true on success
Reads the list of aviable profiles.
- Return value:
-
true on success
Reads the active profile.
- Parameters:
-
force reading (even if it was already set)
- Return value:
-
true on success
Reads the descriptions of all aviable profiles.
- Return value:
-
true on success
Check if the module is run for first time and reads user settings (currently close_popups check)
- Return value:
-
true on success
Ask user which action should be taken when scom recovery is necessary
- Return value:
-
: `cancel, `recover, `rollback
Read all profile-manager settings
- Return value:
-
true on success
Enables or disables SCPM (depends on value of enabled variable).
- Return value:
-
true on success
Enables SCPM for the first time
general function for writing status (enable/disable)
Rebuilds SCPM database after changing resources.
- Return value:
-
true on success
function for writing modifications in resource groups
Writes the user settings (currently close_popups check).
- Return value:
-
true on success
Write all profile-manager settings
- Return value:
-
true on success
Reads the settings of the selected profile (we already have description from ReadProfileDescriptions()).
- Return value:
-
true on success
Creates a new profile.
- Parameters:
-
name Name of the new profile
- Return value:
-
true
Creates a new profile by copying old one.
- Parameters:
-
source Name of the source profile new Name of the new profile
- Return value:
-
true
Renames a profile.
- Parameters:
-
old Name of the affected profile new New name of the profile
- Return value:
-
true on success
Sets the parameters of the profile. Uses the global variable profile_settings.
- Parameters:
-
name Name of the affected profile settings The map of profile settings
- Return value:
-
true on success
Deletes the profile.
- Parameters:
-
to_delete Name of the affected profile
- Return value:
-
true on success
Calls PrepareSwitch(), which drops switch_info map to file
- Parameters:
-
profile Name of profile to switch to
Saves modified resources of the profile
Switchs to the selected profile.
Checks, what changes will be done to the selected resource after switch. Uses global variable active_resource.
- Return value:
-
The changes.
Sets the "save" flag of selected resource to the opposite value.
- Return value:
-
true on success
Creates the item list for the Table widget.
- Return value:
-
of items
Checks if the name of the new profile consists of valid characters: [a-zA-Z0-9_-.]
- Parameters:
-
name Name of the new profile.
- Return value:
-
true if valid
Checks the existence of the scripts from
- Parameters:
-
settings The map with paths to scripts
- Return value:
-
of non-executable files (empty when all is OK)
Sets the file permitions of scripts from profile_settings to 700.
- Parameters:
-
settings The map with paths to scripts
- Return value:
-
true on success
Checks if the profile settings was modified.
- Parameters:
-
new_settings The map of new profile settings.
- Return value:
-
true if modified
Gets the hash marks (to show in ProgressPopup) from the hashfile
- Return value:
-
number of characters in hashfile
Reads the file with the progress informations.
- Parameters:
-
everything if set to true, returns the entire rest of file
- Return value:
-
the text to show in ProgressPopup (one line in normal case)
Reads the switch info map, which was dumped to file by agent's thread
- Return value:
-
true on success
Checks the return value of agent's thread
- Return value:
-
true if thread finished succesfully
Popup for showing progress informations
- Parameters:
-
position of this progress: (if "first", popup is not closed, for "last" popup is not created) start start of progress (mainly 0) end end of progress (mainly 100)
- Return value:
-
true