192. ProfileManager

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

192.1. Summary of Module Globals

List of Global Functions

List of Global Variables

192.2. Global Functions

192.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

192.2.2. GetDefaultResourceGroups

get the map of default resource groups

Return value

  • map<string,map>

192.2.3. GetHashMarks

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

Return value

  • integer - number of characters in hashfile

192.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)

192.2.5. GetResourceGroupResources

Gets resources of resource group.

Function parameters

  • string groupname

Return value

  • list - of resources

192.2.6. GetResourceGroups

Returns all available resource groups.

Return value

  • map<string,map> - of groups

192.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)

192.2.8. GetUsers

Return the map of users able to run scpm

Return value

  • map<string,string>

192.2.9. GetUsersAllowed

Check if users are able to switch profiles

Return value

  • boolean - the result

192.2.10. Modified

Was anything modified?

Return value

  • boolean

192.2.11. ProgressPopup

Popup for showing progress informations

Function parameters

  • string position

  • integer start

  • integer end

Return value

  • boolean - true

192.2.12. Read

Read all profile-manager settings

Return value

  • boolean - true on success

192.2.13. ReadConfigFile

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

Return value

  • boolean - false when file doesn't exist

192.2.14. ReadResourceGroups

Reads all available resource groups.

Return value

  • boolean - true on success

192.2.15. ReadUsers

Read the set of users allowed to run SCPM

Return value

  • boolean

192.2.16. RebuildDB

Rebuilds SCPM database after changing resources.

Return value

  • boolean - true on success

192.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

192.2.18. ResetResourceGroup

Resets one resource group to default values

Function parameters

  • string groupname

Return value

  • boolean - success

192.2.19. ResetResourceGroups

Resets RG's to default values

Return value

  • boolean - success

192.2.20. Rollback

Calls SCPM::Recover (true)

Return value

  • void

192.2.21. SaveResourceGroups

Save the resource groups edited in YaST UI

Return value

  • boolean - success

192.2.22. SetUsers

Upodate the global map of users

Function parameters

  • map<string,string> current_users

Return value

  • boolean

192.2.23. Wait

Checks the return value of agent's thread

Return value

  • boolean - true if thread finished succesfully

192.2.24. Write

Write all profile-manager settings

Return value

  • boolean - true on success

192.2.25. WriteConfigFile

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

Return value

  • boolean - true

192.2.26. WriteResourceGroups

function for writing modifications in resource groups

Return value

  • boolean

192.2.27. WriteSCPMStatus

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

Return value

  • boolean - true on success

192.2.28. WriteStatus

general function for writing status (enable/disable)

Return value

  • boolean

192.2.29. WriteStatusFirst

Enables SCPM for the first time

Return value

  • void

192.2.30. WriteUsers

Write new set of users allowed to run scpm

Return value

  • boolean

192.2.31. WriteUsersAllowed

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

Return value

  • boolean - success of the action

192.3. Global Variables

192.3.1. conf_modified

if SCPM configuration (stored in scpm_conf map) was modified

192.3.2. enabled

Is SCPM enabled?

192.3.3. hash_size

how many times was progress bar used

192.3.4. initialized

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

192.3.5. needs_recover

Is SCPM recovery? (after something failed)

192.3.6. needs_reinit

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

192.3.7. resource_groups

all resource groups available; filled by ReadResourceGroups()

192.3.8. resource_groups_deleted

list of resource groups marked for deletion

192.3.9. resource_groups_modified

if resource groups were modified

192.3.10. scpm_conf

this map holds the contents of scpm.conf configuration file

192.3.11. scpm_error

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

192.3.12. status_modified

Was enabled/disabled status changed?

192.3.13. users_allowed

If users are available to switch profiles

192.3.14. users_modified

if list of users was modified

192.4. Module Requirements

192.4.1. Module Imports

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

192.4.2. Module Includes