# Buggy code
def call(self, cleanup_protecteds):
    """
    Start the actual minion as a caller minion.

    cleanup_protecteds is list of yard host addresses that should not be
    cleaned up this is to fix race condition when salt-caller minion starts up

    If sub-classed, don't **ever** forget to run:

        super(YourSubClass, self).start()

    NOTE: Run any required code before calling `super()`.
    """
    try:
        self.prepare()
        if check_user(self.config["user"]):
            self.minion.opts["__role"] = kinds.APPL_KIND_NAMES[kinds.applKinds.caller]
            self.minion.opts["raet_cleanup_protecteds"] = cleanup_protecteds
            self.minion.call_in()
    except (KeyboardInterrupt, SaltSystemExit) as exc:
        logger.warn("Stopping the Salt Minion")
        if isinstance(exc, KeyboardInterrupt):
            logger.warn("Exiting on Ctrl-c")
            self.shutdown()
        else:
            logger.error(str(exc))
            self.shutdown(exc.code)


# Traceback (optparse.OptionConflictError)
/usr/lib/python2.7/dist-packages/salt/utils/parsers.py:953: DeprecationWarning: Please stop sub-classing PidfileMix and instead subclass DaemonMixIn which contains the same behavior. PidfileMixin will be supported until Salt Nitrogen (Unreleased).
Traceback (most recent call last):
File "/usr/bin/salt-api", line 8, in <module>
salt_api()
File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 441, in salt_api
sapi = salt.cli.api.SaltAPI()  # pylint: disable=E1120
File "/usr/lib/python2.7/dist-packages/salt/utils/parsers.py", line 152, in __init__
optparse.OptionParser.__init__(self, *args, **kwargs)
File "/usr/lib/python2.7/optparse.py", line 1220, in __init__
add_help=add_help_option)
File "/usr/lib/python2.7/dist-packages/salt/utils/parsers.py", line 233, in _populate_option_list
mixin_setup_func(self)
File "/usr/lib/python2.7/dist-packages/salt/utils/parsers.py", line 962, in _mixin_setup
help=('Specify the location of the pidfile. Default: %default')
File "/usr/lib/python2.7/optparse.py", line 1021, in add_option
self._check_conflict(option)
File "/usr/lib/python2.7/optparse.py", line 996, in _check_conflict
option)
optparse.OptionConflictError: option --pid-file: conflicting option string(s): --pid-file

# Fixed code
def call(self, cleanup_protecteds):
    """
    Start the actual minion as a caller minion.

    cleanup_protecteds is list of yard host addresses that should not be
    cleaned up this is to fix race condition when salt-caller minion starts up

    If sub-classed, don't **ever** forget to run:

        super(YourSubClass, self).start()

    NOTE: Run any required code before calling `super()`.
    """
    try:
        self.prepare()
        if check_user(self.config["user"]):
            self.minion.opts["__role"] = kinds.APPL_KIND_NAMES[kinds.applKinds.caller]
            self.minion.opts["raet_cleanup_protecteds"] = cleanup_protecteds
            self.minion.call_in()
    except (KeyboardInterrupt, SaltSystemExit) as exc:
        log.warn("Stopping the Salt Minion")
        if isinstance(exc, KeyboardInterrupt):
            log.warn("Exiting on Ctrl-c")
            self.shutdown()
        else:
            log.error(str(exc))
            self.shutdown(exc.code)