Utils Module
Utility functions
(e.g. Determining the remote system OS)
You should ALWAYS include this module in your deployment. It contains functions that are used by other modules.
-
modules.utils.bootstrap(deploy_level='staging')[source]
Does nothing in this module.
-
modules.utils.develop(deploy_level='staging')[source]
Does nothing in this module.
-
modules.utils.start(deploy_level='staging')[source]
Does nothing in this module.
-
modules.utils.stop(deploy_level='staging')[source]
Does nothing in this module.
-
modules.utils.try_import(module_name)[source]
Import and return module_name.
>>> try_import("csv")
<module 'csv' from '...'>
Unlike the standard try/except approach to optional imports, inspect
the stack to avoid catching ImportErrors raised from within the
module. Only return None if module_name itself cannot be imported.
>>> try_import("spam.spam.spam") is None
True
-
modules.utils.what_os()[source]
Returns a string indicating the Host OS. Currently
Only supports ‘redhat’ and ‘ubuntu’