YaST2 Developers Documentation: Configuration of profile-manager

Configuration of profile-manager

modules/ProfileManager.ycp
Data for configuration of profile-manager, input and output funcs.

This module has an unstable interface.

Representation of the configuration of profile-manager. Input and output routines.

Imports

  • Directory
  • FileUtils
  • Label
  • Mode
  • NetworkService
  • Package
  • Popup
  • Progress
  • Report
  • String
  • Users
  • UsersCache

Global Variables

Global Functions

Local Variables

Local Functions

global enabled -> boolean

Is SCPM enabled?

global needs_reinit -> boolean

Is SCPM re-initialization needed? (possibly after update)

global needs_recover -> boolean

Is SCPM recovery? (after something failed)

global status_modified -> boolean

Was enabled/disabled status changed?

global resource_groups_modified -> boolean

if resource groups were modified

local save_db -> boolean

if SCPM DB needs to be saved (-> SCPM object desctructor)

global conf_modified -> boolean

if SCPM configuration (stored in scpm_conf map) was modified

global users_modified -> boolean

if list of users was modified

global initialized -> boolean

Is SCPM initialized? This is set to true after first enabling.

global scpm_error -> string

When scpm action fails, the error message is stored here by SetError()

global scpm_conf -> map

this map holds the contents of scpm.conf configuration file

global resource_groups -> map

all resource groups available; filled by ReadResourceGroups()

global resource_groups_deleted -> list

list of resource groups marked for deletion

local users -> map<string,string>

Map of users with permissions to run SCPM

global users_allowed -> boolean

If users are available to switch profiles

local usernames -> list<string>

List of user names, read from system via Users module

local sumfpath -> string

path to scpm qt front-end

local userspath -> string

path to config file with users

local progressfile -> string

The name of the file, where the progress state is beeing written. (The same name must use the scpm agent!)

local progress_size -> integer

how many lines of progress has been pruducted

global hash_size -> integer

how many times was progress bar used

global Modified () -> boolean

Was anything modified?

local ShowError () -> void

This function is called when some scpm command failed. The error message is read and shown in Popup::Error.

local SetError () -> void

This function is called when some scpm command failed. The error message is read and stored in global variable scpm_error.

local SetResourceGroup (string groupname, list resources, string descr) -> boolean

Writes modified resource group.

Parameters:
groupname resource group name
resources list of resources belonging to this group
descr group description
Return value:
success
global GetResourceGroupResources (string groupname) -> list

Gets resources of resource group.

Parameters:
groupname resource group name
Return value:
of resources
global ReadResourceGroups () -> boolean

Reads all available resource groups.

Return value:
true on success
global GetDefaultResourceGroups () -> map<string,map>

get the map of default resource groups

global ResetResourceGroups () -> boolean

Resets RG's to default values

Return value:
success
global ResetResourceGroup (string groupname) -> boolean

Resets one resource group to default values

Parameters:
groupname
Return value:
success
global GetResourceGroups () -> map<string,map>

Returns all available resource groups.

Return value:
of groups
global ReadUsers () -> boolean

Read the set of users allowed to run SCPM

global WriteUsers () -> boolean

Write new set of users allowed to run scpm

global GetUsers () -> map<string,string>

Return the map of users able to run scpm

global GetUsersAllowed () -> boolean

Check if users are able to switch profiles

Return value:
the result
global WriteUsersAllowed () -> boolean

Write the new status if the users are allowed to run SCPM or not

Return value:
success of the action
global SetUsers (map<string,string> current_users) -> boolean

Upodate the global map of users

Parameters:
current_users
global GetUsernames () -> list<string>

Return list of user names available in system First time, read it using yast2-users, use cache for later calls.

Return value:
of user names (for local users)
local AllErrorMessages (string error) -> string

Store error messages generated by multiple commands to one string

Parameters:
error
global SaveResourceGroups () -> boolean

Save the resource groups edited in YaST UI

Return value:
success
global ReadConfigFile () -> boolean

reads a contents of scpm config file (/etc/scpm.conf)

Return value:
false when file doesn't exist
global WriteConfigFile () -> boolean

writes configuration data to scpm config file (/etc/scpm.conf)

Return value:
true
local Initialize () -> boolean

Initialize the SCPM agent.

Return value:
true on success
local ReadSCPMStatus () -> boolean

Checks if SCPM is enabled/disabled/initialized.

Return value:
true on success
global Recover () -> void

Calls SCPM::Recover (false) function, which replays journal after the crash (started in separate agen'ts thread, return value must be checked with Wait)

global Rollback () -> void

Calls SCPM::Recover (true)

local AskForRecoveryPopup () -> symbol

Ask user which action should be taken when scom recovery is necessary

Return value:
: `cancel, `recover, `rollback
global Wait () -> boolean

Checks the return value of agent's thread

Return value:
true if thread finished succesfully
global GetHashMarks () -> integer

Gets the hash marks (to show in ProgressPopup) from the hashfile

Return value:
number of characters in hashfile
global GetProgressText (boolean everything) -> string

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)
global ProgressPopup (string position, integer start, integer end) -> boolean

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
global Read () -> boolean

Read all profile-manager settings

Return value:
true on success
global WriteSCPMStatus () -> boolean

Enables or disables SCPM (depends on value of enabled variable).

Return value:
true on success
global WriteStatusFirst () -> void

Enables SCPM for the first time

global WriteStatus () -> boolean

general function for writing status (enable/disable)

global RebuildDB () -> boolean

Rebuilds SCPM database after changing resources.

Return value:
true on success
global WriteResourceGroups () -> boolean

function for writing modifications in resource groups

global Write () -> boolean

Write all profile-manager settings

Return value:
true on success
global CheckNameValidity (string name) -> boolean

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