YaST2 Developers Documentation: Configuration of sysconfig



functions
files
intro

Configuration of sysconfig

modules/Sysconfig.ycp
Data for configuration of sysconfig, input and output functions.
Representation of the configuration of sysconfig. Input and output routines.

Imports

  • Directory
  • IP
  • Label
  • Progress
  • Report
  • Service
  • String
  • Summary

Global Functions

Local Functions

global Modified () -> boolean

Data was modified?

Return value:
true if modified

global get_name_from_id (string id) -> string

Get variable name from variable identification or empty string if input is invalid

Parameters:
id Variable identification
Return value:
Variable name
Example:
  get_name_from_id("var$file") -> "var"

global get_file_from_id (string id) -> string

Get file name where is variable located from variable identification

Parameters:
id Variable identification
Return value:
File name

global get_only_comment (string input) -> string

Get comment without metadata

Parameters:
input Input string
Return value:
Comment used as variable description

global search (map params, boolean show_progress) -> list<string>

Search in syscnfig files for value

Parameters:
params search parameters
show_progress if true progress bar will be displayed
Return value:
List of found variables (IDs)

global remove_whitespaces (string input) -> string

Remove white spaces at beginning or at the end of string

Parameters:
input Input string
Return value:
String without white spaces

global get_metadata (string input) -> list<string>

Get metadata lines from input string

Parameters:
input Input string
Return value:
Metadata lines in list

global parse_metadata (string comment) -> map<string, string>

Parse metadata from comment

Parameters:
comment Input comment
Return value:
parsed metadata

global get_location_from_id (string id) -> string

Get variable location in tree widget from variable identification

Parameters:
id Variable identification
Return value:
Variable location

global get_description (string varid) -> map<string, any>

Get description of selected variable

Parameters:
varid Variable identification
Return value:
Description map

global set_value (string variable, string new_value, boolean force, boolean force_change) -> symbol

Set new variable value

Parameters:
variable Variable identification
new_value New value
force If true - do not check if new value is valid
force_change Force value as changed even if it is equal to old value
Return value:
Result: `not_found (specified variable was not found in config file), `not_valid (new value is not valid - doesn't match variable type definition), `ok (success)

global modified (string varid) -> boolean

Return modification status of variable

Parameters:
varid Variable identification
Return value:
True if variable was modified

global get_modified () -> list<string>

Get list of modified variables

Return value:
List of modified variables

global get_all () -> list<string>

Get list of all variables

Return value:
List of variable identifications

global get_all_names () -> map<string, list<string> >

Get map of all variables

Return value:
Map of variable names, key is variable name, value is a list of variable identifications

global Read () -> boolean

Read all sysconfig variables

Return value:
true on success

local ConfirmationDialog (string message, string command) -> symbol

Display confirmation dialog

Parameters:
message Confirmation message
command Command to confirm
Return value:
`cont - start command, `skip - skip this command, `abort - skip all remaining commands

local StartCommand (string start_command, string label, string error, string confirm, boolean confirmaction) -> symbol

Start activation command, ask user to confirm it when it is required. Display specified error message when the command fails.

Parameters:
start_command Command to start
label Progress bar label
error Error message displayed when command failes
confirm Confirmation messge
confirmaction Display confirmation dialog
Return value:
`success - command was started, `failed - command failed (non-zero exit value), `skip - command was skipped, `abort - command starting was aborted

global Write () -> boolean

Write all sysconfig settings

Return value:
true on success

global Set (list<map> settings) -> void

Set all sysconfig settings from the list (For use by autoinstallation.)

Parameters:
settings The YCP structure to be set.

global Import (list settings) -> boolean

Set all sysconfig settings from the list and read information from files (For use by autoinstallation.)

Parameters:
settings The YCP structure to be imported.
Return value:
True on success

global Export () -> list

Dump the sysconfig settings to a single map (For use by autoinstallation.)

Return value:
Dumped settings (later acceptable by Import ())

global Summary () -> string

Create a textual summary

Return value:
summary of the current configuration

YaST2 Developers Documentation