7. Layer root

7.1. Overview

This is the root layer of the MFCOM module.

This layer mainly includes core libraries and utilities like :

  • layerapi2 library and utilities which manage the layer system
  • wrappers (python2, python3, python…)
  • (and some other documented below)

The root layer is loaded by default and does not depend on another layer. This is the layer dependencies root.

7.2. Special focus on python wrappers

7.2.1. python2 wrapper

The python2 wrapper is available in ${MFEXT_HOME}/bin. It executes a python2 interpreter with following layers loaded :

  • python2_core@mfext
  • python2@mfext (if installed)
  • python2@mfcom (if installed)
  • python2@{current_module} (if installed)

So, if you want to execute a python2 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python2

print "this code will be always executed in python2 environment"
print "(thanks to the above python2 shebang)"

or

python2 /path/to/a/python2/script.py

7.2.2. python3 wrapper

The python3 wrapper is available in ${MFEXT_HOME}/bin. It executes a python3 interpreter with following layers loaded :

  • python3_core@mfext
  • python3@mfext (if installed)
  • python3@mfcom (if installed)
  • python3@{current_module} (if installed)

So, if you want to execute a python3 script without any question about currently loaded layers, this is the way to go.

For example:

#!/usr/bin/env python3

print("this code will be always executed in python3 environment")
print("(thanks to the above python3 shebang)")

or

python3 /path/to/a/python3/script.py

7.2.3. python wrapper

The python wrapper is available in ${MFEXT_HOME}/bin. It works exactly as the two above wrappers. But the major python version is selected with the METWORK_PYTHON_MODE environment variable.

7.3. Metadata

7.3.1. Layer Home

/opt/metwork-mfcom-0.7

7.3.2. Label

root@mfcom

7.3.3. Dependencies

7.4. Utilities

7.4.1. mfcom_wrapper

usage: /opt/metwork-mfcom-0.7/bin/mfcom_wrapper COMMAND_TO_WRAP [COMMAND_ARG1] [COMMAND_ARG2] [...]
  => launch the given command within metwork/mfcom environnent
  => note: the current environnent is cleared before
  =>       (only MODULE_RUNTIME_SUFFIX, MODULE_RUNTIME_HOME and some standard env var (HOME, TERM, DISPLAY...)
            are keeped intact)

7.4.2. echo_ok

Usage:
  echo_ok [OPTION?] [MESSAGE] - write OK (with colors if supported) and a little optional message

Help Options:
  -h, --help       Show help options

7.4.3. echo_bold

Usage:
  echo_bold [OPTION?] [MESSAGE] - write MESSAGE in bold

Help Options:
  -h, --help       Show help options

7.4.4. echo_warning

Usage:
  echo_warning [OPTION?] [MESSAGE] - write WARNING (with colors if supported) and a little optional message

Help Options:
  -h, --help       Show help options

7.4.5. echo_nok

Usage:
  echo_nok [OPTION?] [MESSAGE] - write ERROR (with colors if supported) and a little optional message

Help Options:
  -h, --help       Show help options

7.4.6. echo_running

Usage:
  echo_running [OPTION?] - write RUNNING (with colors if supported)

Help Options:
  -h, --help       Show help options

7.4.7. config.py

usage: config.py [-h] path [section] [option] [config]

Lit le contenu d'un fichier .ini

positional arguments:
  path        Chemin du fichier de config a visualiser
  section     Precise la section a afficher
  option      Precise l'option a afficher
  config      Precise la config a utiliser pour l'affichage

optional arguments:
  -h, --help  show this help message and exit

7.4.8. get_unique_hexa_identifier

Usage:
  get_unique_hexa_identifier [OPTION?] - return a unique hexa identifier

Help Options:
  -h, --help       Show help options