def _replace_and_publish(self, path, prettyname, value, device):
        """
        Inputs a complete path for a metric and a value.
        Replace the metric name and publish.
        """
        if value is None:
            return
        newpath = path
        # Change metric name before publish if needed.
        newpath = ".".join([".".join(path.split(".")[:-1]), prettyname])
        metric = Metric(newpath, value, precision=4, host=device)
        self.publish_metric(metric)

        Inputs a complete path for a metric and a value.
        Replace the metric name and publish.
        
src/collectors/netapp/netapp.py