def set_catalog(url):
    # This command always returns an error code, though it completes
    # successfully. Success will be determined by making sure get_catalog
    # returns the passed url
    cmd = ['softwareupdate', '--set-catalog', url]

    try:
        salt.utils.mac_utils.execute_return_success(cmd)
    except CommandExecutionError as exc:
        pass

    return get_catalog() == url
.. versionadded:: 2016.3.0
dataset/ETHPy150Open saltstack/salt/salt/modules/mac_softwareupdate.py/set_catalog