# Buggy code
def dns():
    """
    Parse the resolver configuration file

     .. versionadded:: 2016.3.0
    """
    # Provides:
    #   dns
    if salt.utils.is_windows() or "proxyminion" in __opts__:
        return {}

    resolv = salt.utils.dns.parse_resolv()
    keys = ["nameservers", "ip4_nameservers", "sortlist"]
    if __opts__.get("ipv6", True):
        keys.append("ip6_nameservers")
    for key in keys:
        if key in resolv:
            resolv[key] = [str(i) for i in resolv[key]]

    return {"dns": resolv} if resolv else {}


# Traceback (TypeError)
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
TypeError: can't serialize IPv6Address('fd00::ca0e:14ff:fea8:2344')
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/salt-call", line 11, in <module>
salt_call()
File "/usr/lib64/python2.7/site-packages/salt/scripts.py", line 379, in salt_call
client.run()
File "/usr/lib64/python2.7/site-packages/salt/cli/call.py", line 48, in run
caller = salt.cli.caller.Caller.factory(self.config)
File "/usr/lib64/python2.7/site-packages/salt/cli/caller.py", line 79, in factory
return ZeroMQCaller(opts, **kwargs)
File "/usr/lib64/python2.7/site-packages/salt/cli/caller.py", line 274, in __init__
super(ZeroMQCaller, self).__init__(opts)
File "/usr/lib64/python2.7/site-packages/salt/cli/caller.py", line 102, in __init__
self.minion = salt.minion.SMinion(opts)
File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 669, in __init__
self.gen_modules(initial_load=True)
File "/usr/lib64/python2.7/site-packages/salt/minion.py", line 717, in gen_modules
pillarenv=self.opts.get('pillarenv'),
File "/usr/lib64/python2.7/site-packages/salt/pillar/__init__.py", line 162, in compile_pillar
dictkey='pillar',
File "/usr/lib64/python2.7/site-packages/salt/utils/async.py", line 75, in wrap
ret = self._block_future(ret)
File "/usr/lib64/python2.7/site-packages/salt/utils/async.py", line 85, in _block_future
return future.result()
File "/usr/lib64/python2.7/site-packages/tornado/concurrent.py", line 237, in result
raise_exc_info(self._exc_info)
File "/usr/lib64/python2.7/site-packages/tornado/gen.py", line 285, in wrapper
yielded = next(result)
File "/usr/lib64/python2.7/site-packages/salt/transport/zeromq.py", line 190, in crypted_transfer_decode_dictentry
self._package_load(self.auth.crypticle.dumps(load)),
File "/usr/lib64/python2.7/site-packages/salt/crypt.py", line 1267, in dumps
return self.encrypt(self.PICKLE_PAD + self.serial.dumps(obj))
File "/usr/lib64/python2.7/site-packages/salt/payload.py", line 181, in dumps
return msgpack.dumps(msg, use_bin_type=use_bin_type)
File "/usr/lib64/python2.7/site-packages/msgpack/__init__.py", line 47, in packb
return Packer(**kwargs).pack(o)
File "msgpack/_packer.pyx", line 231, in msgpack._packer.Packer.pack (msgpack/_packer.cpp:3661)
File "msgpack/_packer.pyx", line 233, in msgpack._packer.Packer.pack (msgpack/_packer.cpp:3503)
File "msgpack/_packer.pyx", line 192, in msgpack._packer.Packer._pack (msgpack/_packer.cpp:2657)
File "msgpack/_packer.pyx", line 192, in msgpack._packer.Packer._pack (msgpack/_packer.cpp:2657)
File "msgpack/_packer.pyx", line 192, in msgpack._packer.Packer._pack (msgpack/_packer.cpp:2657)
File "msgpack/_packer.pyx", line 221, in msgpack._packer.Packer._pack (msgpack/_packer.cpp:3230)
File "msgpack/_packer.pyx", line 228, in msgpack._packer.Packer._pack (msgpack/_packer.cpp:3382)
TypeError: can't serialize IPv6Address('fd00::ca0e:14ff:fea8:2344')

# Fixed code
def dns():
    """
    Parse the resolver configuration file

     .. versionadded:: 2016.3.0
    """
    # Provides:
    #   dns
    if salt.utils.is_windows() or "proxyminion" in __opts__:
        return {}

    resolv = salt.utils.dns.parse_resolv()
    for key in ("nameservers", "ip4_nameservers", "ip6_nameservers", "sortlist"):
        if key in resolv:
            resolv[key] = [str(i) for i in resolv[key]]

    return {"dns": resolv} if resolv else {}