203. ProfileManager

Data for configuration of profile-manager, input and output funcs.

203.1. Summary of Module Globals

List of Global Functions

List of Global Variables

203.2. Global Functions

203.2.1. CheckNameValidity

Checks if the name of the new profile consists of valid characters: [a-zA-Z0-9_-.]

Function parameters

  • string name

Return value

  • boolean - true if valid

203.2.2. GetDefaultResourceGroups

get the map of default resource groups

Return value

  • map<string,map>

203.2.3. GetHashMarks

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

Return value

  • integer - number of characters in hashfile

203.2.4. GetProgressText

Reads the file with the progress informations.

Function parameters

  • boolean everything

Return value

  • string - the text to show in ProgressPopup (one line in normal case)

203.2.5. GetResourceGroupResources

Gets resources of resource group.

Function parameters

  • string groupname

Return value

  • list - of resources

203.2.6. GetResourceGroups

Returns all available resource groups.

Return value

  • map<string,map> - of groups

203.2.7. GetUsernames

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

Return value

  • list<string> - of user names (for local users)

203.2.8. GetUsers

Return the map of users able to run scpm

Return value

  • map<string,string>

203.2.9. GetUsersAllowed

Check if users are able to switch profiles

Return value

  • boolean - the result

203.2.10. Modified

Was anything modified?

Return value

  • boolean

203.2.11. ProgressPopup

Popup for showing progress informations

Function parameters

  • string position

  • integer start

  • integer end

Return value

  • boolean - true

203.2.12. Read

Read all profile-manager settings

Return value

  • boolean - true on success

203.2.13. ReadConfigFile

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

Return value

  • boolean - false when file doesn't exist

203.2.14. ReadResourceGroups

Reads all available resource groups.

Return value

  • boolean - true on success

203.2.15. ReadUsers

Read the set of users allowed to run SCPM

Return value

  • boolean

203.2.16. RebuildDB

Rebuilds SCPM database after changing resources.

Return value

  • boolean - true on success

203.2.17. Recover

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

Return value

  • void

203.2.18. ResetResourceGroup

Resets one resource group to default values

Function parameters

  • string groupname

Return value

  • boolean - success

203.2.19. ResetResourceGroups

Resets RG's to default values

Return value

  • boolean - success

203.2.20. Rollback

Calls SCPM::Recover (true)

Return value

  • void

203.2.21. SaveResourceGroups

Save the resource groups edited in YaST UI

Return value

  • boolean - success

203.2.22. SetUsers

Upodate the global map of users

Function parameters

  • map<string,string> current_users

Return value

  • boolean

203.2.23. Wait

Checks the return value of agent's thread

Return value

  • boolean - true if thread finished succesfully

203.2.24. Write

Write all profile-manager settings

Return value

  • boolean - true on success

203.2.25. WriteConfigFile

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

Return value

  • boolean - true

203.2.26. WriteResourceGroups

function for writing modifications in resource groups

Return value

  • boolean

203.2.27. WriteSCPMStatus

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

Return value

  • boolean - true on success

203.2.28. WriteStatus

general function for writing status (enable/disable)

Return value

  • boolean

203.2.29. WriteStatusFirst

Enables SCPM for the first time

Return value

  • void

203.2.30. WriteUsers

Write new set of users allowed to run scpm

Return value

  • boolean

203.2.31. WriteUsersAllowed

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

Return value

  • boolean - success of the action

203.3. Global Variables

203.3.1. conf_modified

if SCPM configuration (stored in scpm_conf map) was modified

203.3.2. enabled

Is SCPM enabled?

203.3.3. hash_size

how many times was progress bar used

203.3.4. initialized

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

203.3.5. needs_recover

Is SCPM recovery? (after something failed)

203.3.6. needs_reinit

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

203.3.7. resource_groups

all resource groups available; filled by ReadResourceGroups()

203.3.8. resource_groups_deleted

list of resource groups marked for deletion

203.3.9. resource_groups_modified

if resource groups were modified

203.3.10. scpm_conf

this map holds the contents of scpm.conf configuration file

203.3.11. scpm_error

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

203.3.12. status_modified

Was enabled/disabled status changed?

203.3.13. users_allowed

If users are available to switch profiles

203.3.14. users_modified

if list of users was modified

203.4. Module Requirements

203.4.1. Module Imports

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

203.4.2. Module Includes