212. SourceManager

SourceManager settings, input and output functions

212.1. Summary of Module Globals

List of Global Functions

  • Abort - Abort function

  • AbortFunction - Abort function return boolean return true if abort

  • 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)

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

  • 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

212.2. Global Functions

212.2.1. Abort

Abort function

Return value

  • boolean - return true if abort

212.2.2. AbortFunction

Abort function return boolean return true if abort

Return value

  • boolean

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

212.2.4. CommitSources

Commit changed sources

Return value

  • boolean

212.2.5. Export

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

Return value

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

212.2.6. GetSrcIdByIndex

Get Source ID by index

Function parameters

  • integer idx

Return value

  • integer

212.2.7. Import

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

Function parameters

  • map settings

Return value

  • boolean - True on success

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

212.2.9. Modified

Prototypes

Return value

  • boolean

212.2.10. Modified

Data was modified?

Return value

  • boolean - true if modified

212.2.11. Overview

Create an overview table with all configured cards

Return value

  • list - table items

212.2.12. Read

Read all source-manager settings

Return value

  • boolean - true on success

212.2.13. 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" ],
 ]

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

212.2.15. SetUrlByIndex

Set current used source URL by index

Function parameters

  • integer idx

Return value

  • void

212.2.16. SourceData

Gather Source Metadata

Function parameters

  • integer source

Return value

  • map

212.2.17. Summary

Create a textual summary and a list of unconfigured cards

Return value

  • list - summary of the current configuration

212.2.18. SyncAddedAndDeleted

Sync the changed sources to ZenWorks

Function parameters

  • list<integer> added_src_ids

  • list<integer> deleted_src_ids

Return value

  • boolean - success

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

212.2.20. Unlock

Other processes may access the source database again

Return value

  • void

212.2.21. Write

Write all source-manager settings

Return value

  • boolean - true on success

212.2.22. createSource

Create a Source from an URL

Function parameters

  • string url

Return value

  • symbol

212.2.23. deleteSourceByIndex

Delete Source by Source Index

Function parameters

  • integer idx

Return value

  • void

212.2.24. deleteSourceBySrcId

Delete Source by Source ID

Function parameters

  • integer SrcId

Return value

  • void

212.2.25. deleteSourceByUrl

Delete Source by Source URL

Function parameters

  • string url

Return value

  • void

212.2.26. getSourceId

Get Source ID when only URL is known

Function parameters

  • string url

Return value

  • integer

212.3. Global Variables

212.3.1. modified

Data was modified?

212.3.2. proposal_valid

212.4. Module Requirements

212.4.1. Module Imports

  • Arch
  • HTML
  • InstURL
  • Label
  • Message
  • Mode
  • Popup
  • Progress
  • Report
  • SLP
  • Stage
  • String
  • Summary
  • URL

212.4.2. Module Includes