code: def _ows_check_charm_func(state, message, charm_func_with_configs):
      
      if charm_func_with_configs:
          charm_state, charm_message = charm_func_with_configs()
          if (charm_state != 'active' and
                  charm_state != 'unknown' and
                  charm_state is not None):
              state = workload_state_compare(state, charm_state)
              if message:
                  charm_message = charm_message.replace("Incomplete relations: ",
                                                        "")
                  message = "{}, {}".format(message, charm_message)
              else:
                  message = charm_message
      return state, message
docs: Run a custom check function for the charm to see if it wants to
      change the state.  This is only run if not in 'maintenance' and
      tests to see if the new state is more important that the previous
      one determined by the interfaces/relations check.
  
      @param state: the previously determined state so far.
      @param message: the user orientated message so far.
      @param charm_func: a callable function that returns state, message
      @returns state, message strings.