# Buggy code
def absent(name):
    """
    Verify that the named file or directory is absent, this will work to
    reverse any of the functions in the file state module.

    name
        The path which should be deleted
    """
    ret = {"name": name, "changes": {}, "result": True, "comment": ""}
    if not os.path.isabs(name):
        return _error(ret, "Specified file {0} is not an absolute path".format(name))
    if name == "/":
        return _error(ret, 'Refusing to make "/" absent')
    if os.path.isfile(name) or os.path.islink(name):
        if __opts__["test"]:
            ret["result"] = None
            ret["comment"] = "File {0} is set for removal".format(name)
            return ret
        try:
            __salt__["file.remove"](name)
            ret["comment"] = "Removed file {0}".format(name)
            ret["changes"]["removed"] = name
            return ret
        except (OSError, IOError):
            return _error(ret, "Failed to remove file {0}".format(name))

    elif os.path.isdir(name):
        if __opts__["test"]:
            ret["result"] = None
            ret["comment"] = "Directory {0} is set for removal".format(name)
            return ret
        try:
            shutil.rmtree(name)
            ret["comment"] = "Removed directory {0}".format(name)
            ret["changes"]["removed"] = name
            return ret
        except (OSError, IOError):
            return _error(ret, "Failed to remove directory {0}".format(name))

    ret["comment"] = "File {0} is not present".format(name)
    return ret


# Traceback (AttributeError)
[ERROR   ] Error in function _master_opts:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/master.py", line 1444, in run_func
ret = getattr(self, func)(load)
File "/usr/lib/pymodules/python2.7/salt/master.py", line 891, in _master_opts
envs = self._file_envs()
File "/usr/lib/pymodules/python2.7/salt/fileserver/__init__.py", line 153, in envs
ret.update(self.servers[fstr]())
File "/usr/lib/pymodules/python2.7/salt/fileserver/hgfs.py", line 176, in envs
tags = repo.get_tags()
AttributeError: 'hgclient' object has no attribute 'get_tags'

# Fixed code
def absent(name):
    """
    Verify that the named file or directory is absent, this will work to
    reverse any of the functions in the file state module.

    name
        The path which should be deleted
    """
    ret = {"name": name, "changes": {}, "result": True, "comment": ""}
    if not os.path.isabs(name):
        return _error(ret, "Specified file {0} is not an absolute path".format(name))
    if name == "/":
        return _error(ret, 'Refusing to make "/" absent')
    if os.path.isfile(name) or os.path.islink(name):
        if __opts__["test"]:
            ret["result"] = None
            ret["comment"] = "File {0} is set for removal".format(name)
            return ret
        try:
            __salt__["file.remove"](name)
            ret["comment"] = "Removed file {0}".format(name)
            ret["changes"]["removed"] = name
            return ret
        except CommandExecutionError as exc:
            return _error(ret, "{0}".format(exc))

    elif os.path.isdir(name):
        if __opts__["test"]:
            ret["result"] = None
            ret["comment"] = "Directory {0} is set for removal".format(name)
            return ret
        try:
            shutil.rmtree(name)
            ret["comment"] = "Removed directory {0}".format(name)
            ret["changes"]["removed"] = name
            return ret
        except (OSError, IOError):
            return _error(ret, "Failed to remove directory {0}".format(name))

    ret["comment"] = "File {0} is not present".format(name)
    return ret