187. ProfileManager

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

187.1. Summary of Module Globals

List of Global Functions

List of Global Variables

187.2. Global Functions

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

187.2.2. GetDefaultResourceGroups

get the map of default resource groups

Return value

  • map<string,map>

187.2.3. GetHashMarks

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

Return value

  • integer - number of characters in hashfile

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

187.2.5. GetResourceGroupResources

Gets resources of resource group.

Function parameters

  • string groupname

Return value

  • list - of resources

187.2.6. GetResourceGroups

Returns all available resource groups.

Return value

  • map<string,map> - of groups

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

187.2.8. GetUsers

Return the map of users able to run scpm

Return value

  • map<string,string>

187.2.9. GetUsersAllowed

Check if users are able to switch profiles

Return value

  • boolean - the result

187.2.10. Modified

Was anything modified?

Return value

  • boolean

187.2.11. ProgressPopup

Popup for showing progress informations

Function parameters

  • string position

  • integer start

  • integer end

Return value

  • boolean - true

187.2.12. Read

Read all profile-manager settings

Return value

  • boolean - true on success

187.2.13. ReadConfigFile

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

Return value

  • boolean - false when file doesn't exist

187.2.14. ReadResourceGroups

Reads all available resource groups.

Return value

  • boolean - true on success

187.2.15. ReadUsers

Read the set of users allowed to run SCPM

Return value

  • boolean

187.2.16. RebuildDB

Rebuilds SCPM database after changing resources.

Return value

  • boolean - true on success

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

187.2.18. ResetResourceGroup

Resets one resource group to default values

Function parameters

  • string groupname

Return value

  • boolean - success

187.2.19. ResetResourceGroups

Resets RG's to default values

Return value

  • boolean - success

187.2.20. Rollback

Calls SCPM::Recover (true)

Return value

  • void

187.2.21. SaveResourceGroups

Save the resource groups edited in YaST UI

Return value

  • boolean - success

187.2.22. SetUsers

Upodate the global map of users

Function parameters

  • map<string,string> current_users

Return value

  • boolean

187.2.23. Wait

Checks the return value of agent's thread

Return value

  • boolean - true if thread finished succesfully

187.2.24. Write

Write all profile-manager settings

Return value

  • boolean - true on success

187.2.25. WriteConfigFile

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

Return value

  • boolean - true

187.2.26. WriteResourceGroups

function for writing modifications in resource groups

Return value

  • boolean

187.2.27. WriteSCPMStatus

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

Return value

  • boolean - true on success

187.2.28. WriteStatus

general function for writing status (enable/disable)

Return value

  • boolean

187.2.29. WriteStatusFirst

Enables SCPM for the first time

Return value

  • void

187.2.30. WriteUsers

Write new set of users allowed to run scpm

Return value

  • boolean

187.2.31. WriteUsersAllowed

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

Return value

  • boolean - success of the action

187.3. Global Variables

187.3.1. conf_modified

if SCPM configuration (stored in scpm_conf map) was modified

187.3.2. enabled

Is SCPM enabled?

187.3.3. hash_size

how many times was progress bar used

187.3.4. initialized

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

187.3.5. needs_recover

Is SCPM recovery? (after something failed)

187.3.6. needs_reinit

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

187.3.7. resource_groups

all resource groups available; filled by ReadResourceGroups()

187.3.8. resource_groups_deleted

list of resource groups marked for deletion

187.3.9. resource_groups_modified

if resource groups were modified

187.3.10. scpm_conf

this map holds the contents of scpm.conf configuration file

187.3.11. scpm_error

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

187.3.12. status_modified

Was enabled/disabled status changed?

187.3.13. users_allowed

If users are available to switch profiles

187.3.14. users_modified

if list of users was modified

187.4. Module Requirements

187.4.1. Module Imports

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

187.4.2. Module Includes