Werk #6057: Changed GUI internal API functions
Component | User interface | ||||||||||||
Title | Changed GUI internal API functions | ||||||||||||
Date | May 7, 2018 | ||||||||||||
Level | Prominent Change | ||||||||||||
Class | New Feature | ||||||||||||
Compatibility | Incompatible - Manual interaction might be required | ||||||||||||
Checkmk versions & editions |
|
During development of version 1.6 we have made a lot of internal changes to the GUI internal code. In case you developed you own GUI extensions, you may likely be affected by this. The following table tries to summarize the most relevant changes to make it easier for you to port your custom code:
Moved exceptions to gui_exceptions module
Use from gui_exceptions import .. to import the exception objects you need. Available are: MKAuthException, MKUnauthenticatedException, MKGeneralException, MKUserError, MKInternalError.
Moved lqencode() to livestatus module
Use import livestatus and livestatus.lqencode().
Moved format_plugin_output() to views
Use import view and views.format_plugin_output().
Moved make_nagios_directory() and make_nagios_directories() to cmk.utils.store
Use import cmk.utils.store and cmk.utils.store.mkdir() or cmk.utils.store.makedirs().
Dropped create_user_file()
Use cmk.utils.store.save_file() instead.
Dropped bytes_human_readable()
Use cmk.utils.render.bytes() instead.
Dropped date_human_readable()
Use cmk.utils.render.date() instead.
Dropped percent_human_redable()
Use cmk.utils.render.percent() instead.
Moved make_utf8() to cmk.utils
Use cmk.utils.make_utf8().
Moved quote_shell_string() to cmk.utils
Use cmk.utils.quote_shell_string().
Moved pnp_cleanup() to cmk.utils
Use cmk.utils.pnp_cleanup().
Moved aquire_lock(), release_all_locks(), have_lock() and release_lock() to cmk.utils.store
Use e.g. cmk.utils.store.aquire_lock().
Dropped age_human_readable()
Use cmk.utils.render.approx_age() instead.
Moved render_scientific() to cmk.utils.render
Use cmk.utils.render.scientific().
Moved render_scientific() to cmk.utils.render
Use cmk.utils.render.physical_precision().
Moved several functions to new utils module
Use e.g. utils.drop_dotzero().
These have moved been moved:
- drop_dotzero()
- cmp_version()
- num_split()
- saveint()
- savefloat()
- get_random_string()
- gen_id()
- load_web_plugins()
Dropped tryint()
This has totally been dropped. Implement it on your own in case you really need this.