219. SourceManager

SourceManager settings, input and output functions

219.1. Summary of Module Globals

List of Global Functions

  • Abort - Abort function

  • AbortFunction - Abort function return boolean return true if abort

  • AddSourceTypeSLP - Function scans for SLP installation servers on the network

  • AddUpdateSources - Used by registration. This is really hairy because we simultaneously add them to zypp and zenworks, but not if they are not signed. (thus being better than inst_source)

  • AskForCD -

  • CommitSources - Commit changed sources

  • Export - Dump the source-manager settings to a single map (For use by autoinstallation.)

  • GetSrcIdByIndex - Get Source ID by index

  • Import - Get all source-manager settings from the first parameter (For use by autoinstallation.)

  • InstallationSourceOnPartition - Function returns the partiton name which is used as a source for the installation (IF any partition is used as a source for installation, of course). Otherwise it returns an empty string "". See bugzilla #208222 for more information.

  • Lock - Start a section where other processes (such as ZMD helpers) should not access the source database. #170113 The calls may be nested.

  • Modified - Prototypes

  • Modified - Data was modified?

  • Overview - Create an overview table with all configured cards

  • Read - Read all source-manager settings

  • RunCommandWithTimeout - Runs a bash command with timeout.

  • RunDumbTimeout - Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD'

  • SetUrlByIndex - Set current used source URL by index

  • SourceData - Gather Source Metadata

  • Summary - Create a textual summary and a list of unconfigured cards

  • SyncAddedAndDeleted - Sync the changed sources to ZenWorks

  • SyncYaSTInstSourceWithZMD - Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP source is listed in the ZMD services, adds one if it is missing. Everything is done via the .background agent with timeout (number in seconds).

  • Unlock - Other processes may access the source database again

  • Write - Write all source-manager settings

  • createSource - Create a Source from an URL

  • deleteSourceByIndex - Delete Source by Source Index

  • deleteSourceBySrcId - Delete Source by Source ID

  • deleteSourceByUrl - Delete Source by Source URL

  • getSourceId - Get Source ID when only URL is known

List of Global Variables

219.2. Global Functions

219.2.1. Abort

Abort function

Return value

  • boolean - return true if abort

219.2.2. AbortFunction

Abort function return boolean return true if abort

Return value

  • boolean

219.2.3. AddSourceTypeSLP

Function scans for SLP installation servers on the network

Return value

  • string

219.2.4. AddUpdateSources

Used by registration. This is really hairy because we simultaneously add them to zypp and zenworks, but not if they are not signed. (thus being better than inst_source)

Function parameters

  • list<string> urls

Return value

  • list<string> - a list of added URLs

219.2.5. AskForCD

Function parameters

  • string message

Return value

  • boolean

219.2.6. CommitSources

Commit changed sources

Return value

  • boolean

219.2.7. Export

Dump the source-manager settings to a single map (For use by autoinstallation.)

Return value

  • map - Dumped settings (later acceptable by Import ())

219.2.8. GetSrcIdByIndex

Get Source ID by index

Function parameters

  • integer idx

Return value

  • integer

219.2.9. Import

Get all source-manager settings from the first parameter (For use by autoinstallation.)

Function parameters

  • map settings

Return value

  • boolean - True on success

219.2.10. InstallationSourceOnPartition

Function returns the partiton name which is used as a source for the installation (IF any partition is used as a source for installation, of course). Otherwise it returns an empty string "". See bugzilla #208222 for more information.

Return value

  • string - partition name

219.2.11. Lock

Start a section where other processes (such as ZMD helpers) should not access the source database. #170113 The calls may be nested.

Return value

  • void

219.2.12. Modified

Prototypes

Return value

  • boolean

219.2.13. Modified

Data was modified?

Return value

  • boolean - true if modified

219.2.14. Overview

Create an overview table with all configured cards

Return value

  • list - table items

219.2.15. Read

Read all source-manager settings

Return value

  • boolean - true on success

219.2.16. RunCommandWithTimeout

Runs a bash command with timeout.

Function parameters

  • string run_command

  • string log_command

  • integer script_time_out

Return value

  • map - with out, err and ret_code

Returns map $[
     "exit" : int_return_code,
     "stdout"  : [ "script", "stdout", "lines" ],
     "stderr"  : [ "script", "stderr", "lines" ],
 ]

219.2.17. RunDumbTimeout

Run - with a timeout - on dumb terminal to disable colors etc - using 'exit $?' because of buggy behavior '.background vs. ZMD'

Function parameters

  • string command

  • string log_command

  • integer seconds

Return value

  • map - with out, err and ret_code

219.2.18. SetUrlByIndex

Set current used source URL by index

Function parameters

  • integer idx

Return value

  • void

219.2.19. SourceData

Gather Source Metadata

Function parameters

  • integer source

Return value

  • map

219.2.20. Summary

Create a textual summary and a list of unconfigured cards

Return value

  • list - summary of the current configuration

219.2.21. SyncAddedAndDeleted

Sync the changed sources to ZenWorks

Function parameters

  • list<integer> added_src_ids

  • list<integer> deleted_src_ids

Return value

  • boolean - success

219.2.22. SyncYaSTInstSourceWithZMD

Checks whether ZMD is running, starts it when isn't. Checks whether a ZYPP source is listed in the ZMD services, adds one if it is missing. Everything is done via the .background agent with timeout (number in seconds).

Return value

  • boolean - whether the syncing succeeds

219.2.23. Unlock

Other processes may access the source database again

Return value

  • void

219.2.24. Write

Write all source-manager settings

Return value

  • boolean - true on success

219.2.25. createSource

Create a Source from an URL

Function parameters

  • string url

Return value

  • symbol

219.2.26. deleteSourceByIndex

Delete Source by Source Index

Function parameters

  • integer idx

Return value

  • void

219.2.27. deleteSourceBySrcId

Delete Source by Source ID

Function parameters

  • integer SrcId

Return value

  • void

219.2.28. deleteSourceByUrl

Delete Source by Source URL

Function parameters

  • string url

Return value

  • void

219.2.29. getSourceId

Get Source ID when only URL is known

Function parameters

  • string url

Return value

  • integer

219.3. Global Variables

219.3.1. modified

Data was modified?

219.3.2. proposal_valid

219.4. Module Requirements

219.4.1. Module Imports

  • Arch
  • HTML
  • InstURL
  • Label
  • Linuxrc
  • Message
  • Mode
  • Popup
  • Progress
  • Report
  • SourceManagerSLP
  • Stage
  • String
  • SuSEFirewall
  • Summary
  • URL

219.4.2. Module Includes