'Returns a list of BlockDevicePayload objects based on the passed
bdms.'

@classmethod
def from_instance(cls, instance):

    if (not CONF.notifications.bdms_in_notifications):
        return None
    instance_bdms = instance.get_bdms()
    bdms = []
    if (instance_bdms is not None):
        for bdm in instance_bdms:
            if (bdm.volume_id is not None):
                bdms.append(cls(bdm))
    return bdms
