# Buggy code
def is_profile_configured(opts, provider, profile_name):
    """
    Check if the requested profile contains the minimum required parameters for
    a profile.

    Required parameters include image, provider, and size keys.

    .. versionadded:: Beryllium
    """
    required_keys = ["image", "provider", "size"]
    alias, driver = provider.split(":")
    provider_key = opts["providers"][alias][driver]
    profile_key = opts["providers"][alias][driver]["profiles"][profile_name]

    # Check if image and/or size are supplied in the provider config. If either
    # one is present, remove it from the required_keys list.
    for item in required_keys:
        if item in provider_key:
            required_keys.remove(item)

    # Check for remaining required parameters in the profile config.
    for item in required_keys:
        if profile_key.get(item, None) is None:
            # There's at least one required configuration item which is not set.
            log.error(
                "The required {0!r} configuration setting is missing from the "
                "{1!r} profile, which is configured "
                "under the {2!r} alias.".format(item, profile_name, alias)
            )
            return False

    return True


# Traceback (AttributeError)
... proceeding
[INFO    ] Calculating dependencies for app2.test
[INFO    ] Calculating dependencies for db5.test
[INFO    ] Calculating dependencies for app1.test
[INFO    ] Calculating dependencies for db1.test
[INFO    ] Calculating dependencies for msg0.test
[INFO    ] Calculating dependencies for web1.test
[INFO    ] Calculating dependencies for sso1.test
[INFO    ] Calculating dependencies for app3.test
[INFO    ] Calculating dependencies for db4.test
[INFO    ] Calculating dependencies for db3.test
[INFO    ] Calculating dependencies for db0.test
[INFO    ] Calculating dependencies for app0.test
[INFO    ] Calculating dependencies for msg1.test
[INFO    ] Calculating dependencies for web0.test
[INFO    ] Calculating dependencies for db6.test
[INFO    ] Calculating dependencies for sso0.test
[INFO    ] Since parallel deployment is in use, ssh console output is disabled. All ssh output will be logged though
[INFO    ] Cloud pool size: 16
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-4-2-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-4-2-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-16-4-100' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] The required 'size' configuration setting is missing from the 'mel-8-4-25' profile, which is configured under the '9s-softlayer' alias.
[ERROR   ] Caught Exception, terminating workers
TRACE: 'bool' object has no attribute 'pop'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
ret = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2215, in create_multiprocessing
output.pop('deploy_kwargs', None)
AttributeError: 'bool' object has no attribute 'pop'



Error: There was a query error: Exception caught
Caught Exception, terminating workers
TRACE: 'bool' object has no attribute 'pop'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
ret = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2215, in create_multiprocessing
output.pop('deploy_kwargs', None)
AttributeError: 'bool' object has no attribute 'pop'

# Fixed code
def is_profile_configured(opts, provider, profile_name):
    """
    Check if the requested profile contains the minimum required parameters for
    a profile.

    Required parameters include image, provider, and size keys.

    .. versionadded:: Beryllium
    """
    # Create a list of standard, required dict keys required by all drivers.
    required_keys = ["image", "provider"]
    alias, driver = provider.split(":")

    # Most drivers require a size to be set, but some do not.
    driver_no_size = ["parallels", "softlayer", "softlayer_hw"]

    if driver not in driver_no_size:
        required_keys.append("size")

    provider_key = opts["providers"][alias][driver]
    profile_key = opts["providers"][alias][driver]["profiles"][profile_name]

    # Check if image and/or size are supplied in the provider config. If either
    # one is present, remove it from the required_keys list.
    for item in required_keys:
        if item in provider_key:
            required_keys.remove(item)

    # Check for remaining required parameters in the profile config.
    for item in required_keys:
        if profile_key.get(item, None) is None:
            # There's at least one required configuration item which is not set.
            log.error(
                "The required {0!r} configuration setting is missing from the "
                "{1!r} profile, which is configured "
                "under the {2!r} alias.".format(item, profile_name, alias)
            )
            return False

    return True