215. ProfileManager

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

215.1. Authors

  • Jiri Suchomel <jsuchome@suse.cz>

215.2. Summary of Module Globals

List of Global Functions

List of Global Variables

215.3. Global Functions

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

215.3.2. GetDefaultResourceGroups

get the map of default resource groups

Return value

  • map<string,map>

215.3.3. GetHashMarks

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

Return value

  • integer - number of characters in hashfile

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

215.3.5. GetResourceGroupResources

Gets resources of resource group.

Function parameters

  • string groupname

Return value

  • list - of resources

215.3.6. GetResourceGroups

Returns all available resource groups.

Return value

  • map<string,map> - of groups

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

215.3.8. GetUsers

Return the map of users able to run scpm

Return value

  • map<string,string>

215.3.9. GetUsersAllowed

Check if users are able to switch profiles

Return value

  • boolean - the result

215.3.10. Modified

Was anything modified?

Return value

  • boolean

215.3.11. ProgressPopup

Popup for showing progress informations

Function parameters

  • string position

  • integer start

  • integer end

Return value

  • boolean - true

215.3.12. Read

Read all profile-manager settings

Return value

  • boolean - true on success

215.3.13. ReadConfigFile

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

Return value

  • boolean - false when file doesn't exist

215.3.14. ReadResourceGroups

Reads all available resource groups.

Return value

  • boolean - true on success

215.3.15. ReadUsers

Read the set of users allowed to run SCPM

Return value

  • boolean

215.3.16. RebuildDB

Rebuilds SCPM database after changing resources.

Return value

  • boolean - true on success

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

215.3.18. ResetResourceGroup

Resets one resource group to default values

Function parameters

  • string groupname

Return value

  • boolean - success

215.3.19. ResetResourceGroups

Resets RG's to default values

Return value

  • boolean - success

215.3.20. Rollback

Calls SCPM::Recover (true)

Return value

  • void

215.3.21. SaveResourceGroups

Save the resource groups edited in YaST UI

Return value

  • boolean - success

215.3.22. SetUsers

Upodate the global map of users

Function parameters

  • map<string,string> current_users

Return value

  • boolean

215.3.23. Wait

Checks the return value of agent's thread

Return value

  • boolean - true if thread finished succesfully

215.3.24. Write

Write all profile-manager settings

Return value

  • boolean - true on success

215.3.25. WriteConfigFile

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

Return value

  • boolean - true

215.3.26. WriteResourceGroups

function for writing modifications in resource groups

Return value

  • boolean

215.3.27. WriteSCPMStatus

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

Return value

  • boolean - true on success

215.3.28. WriteStatus

general function for writing status (enable/disable)

Return value

  • boolean

215.3.29. WriteStatusFirst

Enables SCPM for the first time

Return value

  • void

215.3.30. WriteUsers

Write new set of users allowed to run scpm

Return value

  • boolean

215.3.31. WriteUsersAllowed

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

Return value

  • boolean - success of the action

215.4. Global Variables

215.4.1. conf_modified

if SCPM configuration (stored in scpm_conf map) was modified

215.4.2. enabled

Is SCPM enabled?

215.4.3. hash_size

how many times was progress bar used

215.4.4. initialized

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

215.4.5. needs_recover

Is SCPM recovery? (after something failed)

215.4.6. needs_reinit

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

215.4.7. resource_groups

all resource groups available; filled by ReadResourceGroups()

215.4.8. resource_groups_deleted

list of resource groups marked for deletion

215.4.9. resource_groups_modified

if resource groups were modified

215.4.10. scpm_conf

this map holds the contents of scpm.conf configuration file

215.4.11. scpm_error

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

215.4.12. status_modified

Was enabled/disabled status changed?

215.4.13. users_allowed

If users are available to switch profiles

215.4.14. users_modified

if list of users was modified

215.5. Module Requirements

215.5.1. Module Imports

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

215.5.2. Module Includes