219. ProfileManager

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

219.1. Summary of Module Globals

List of Global Functions

List of Global Variables

219.2. Global Functions

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

219.2.2. GetDefaultResourceGroups

get the map of default resource groups

Return value

  • map<string,map>

219.2.3. GetHashMarks

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

Return value

  • integer - number of characters in hashfile

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

219.2.5. GetResourceGroupResources

Gets resources of resource group.

Function parameters

  • string groupname

Return value

  • list - of resources

219.2.6. GetResourceGroups

Returns all available resource groups.

Return value

  • map<string,map> - of groups

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

219.2.8. GetUsers

Return the map of users able to run scpm

Return value

  • map<string,string>

219.2.9. GetUsersAllowed

Check if users are able to switch profiles

Return value

  • boolean - the result

219.2.10. Modified

Was anything modified?

Return value

  • boolean

219.2.11. ProgressPopup

Popup for showing progress informations

Function parameters

  • string position

  • integer start

  • integer end

Return value

  • boolean - true

219.2.12. Read

Read all profile-manager settings

Return value

  • boolean - true on success

219.2.13. ReadConfigFile

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

Return value

  • boolean - false when file doesn't exist

219.2.14. ReadResourceGroups

Reads all available resource groups.

Return value

  • boolean - true on success

219.2.15. ReadUsers

Read the set of users allowed to run SCPM

Return value

  • boolean

219.2.16. RebuildDB

Rebuilds SCPM database after changing resources.

Return value

  • boolean - true on success

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

219.2.18. ResetResourceGroup

Resets one resource group to default values

Function parameters

  • string groupname

Return value

  • boolean - success

219.2.19. ResetResourceGroups

Resets RG's to default values

Return value

  • boolean - success

219.2.20. Rollback

Calls SCPM::Recover (true)

Return value

  • void

219.2.21. SaveResourceGroups

Save the resource groups edited in YaST UI

Return value

  • boolean - success

219.2.22. SetUsers

Upodate the global map of users

Function parameters

  • map<string,string> current_users

Return value

  • boolean

219.2.23. Wait

Checks the return value of agent's thread

Return value

  • boolean - true if thread finished succesfully

219.2.24. Write

Write all profile-manager settings

Return value

  • boolean - true on success

219.2.25. WriteConfigFile

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

Return value

  • boolean - true

219.2.26. WriteResourceGroups

function for writing modifications in resource groups

Return value

  • boolean

219.2.27. WriteSCPMStatus

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

Return value

  • boolean - true on success

219.2.28. WriteStatus

general function for writing status (enable/disable)

Return value

  • boolean

219.2.29. WriteStatusFirst

Enables SCPM for the first time

Return value

  • void

219.2.30. WriteUsers

Write new set of users allowed to run scpm

Return value

  • boolean

219.2.31. WriteUsersAllowed

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

Return value

  • boolean - success of the action

219.3. Global Variables

219.3.1. conf_modified

if SCPM configuration (stored in scpm_conf map) was modified

219.3.2. enabled

Is SCPM enabled?

219.3.3. hash_size

how many times was progress bar used

219.3.4. initialized

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

219.3.5. needs_recover

Is SCPM recovery? (after something failed)

219.3.6. needs_reinit

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

219.3.7. resource_groups

all resource groups available; filled by ReadResourceGroups()

219.3.8. resource_groups_deleted

list of resource groups marked for deletion

219.3.9. resource_groups_modified

if resource groups were modified

219.3.10. scpm_conf

this map holds the contents of scpm.conf configuration file

219.3.11. scpm_error

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

219.3.12. status_modified

Was enabled/disabled status changed?

219.3.13. users_allowed

If users are available to switch profiles

219.3.14. users_modified

if list of users was modified

219.4. Module Requirements

219.4.1. Module Imports

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

219.4.2. Module Includes