API Documentation

charmhelpers.deprecate(warning, date=None, log=None)

Add a deprecation warning the first time the function is used. The date, which is a string in semi-ISO8660 format indicate the year-month that the function is officially going to be removed.


@deprecate(‘use core/fetch/add_source() instead’, ‘2017-04’) def contributed_add_source_thing(…):

And it then prints to the log ONCE that the function is deprecated. The reason for passing the logging function (log) is so that hookenv.log can be used for a charm if needed.

  • warning – String to indicat where it has moved ot.
  • date – optional sting, in YYYY-MM format to indicate when the function will definitely (probably) be removed.
  • log – The log function to call to log. If not, logs to stdout