'Helper function to create desired volume attach data.
:param NamedConstant attach_type: Type of attach data to create.
:returns: Volume attachment set that conforms to requested attach type.
:rtype: `dict`'

def _pick_attach_data(self, attach_type):

    if (attach_type == self.A.MISSING_ATTACH_DATA):
        return None
    elif (attach_type == self.A.MISSING_INSTANCE_ID):
        attach_data = dict()
        attach_data['Device'] = u'/dev/sdf'
        attach_data['InstanceId'] = ''
        return attach_data
    elif (attach_type == self.A.MISSING_DEVICE):
        attach_data = dict()
        attach_data['Device'] = ''
        attach_data['InstanceId'] = u'i-xyz'
        return attach_data
    elif (attach_type == self.A.ATTACH_SUCCESS):
        attach_data = dict()
        attach_data['Device'] = u'/dev/sdf'
        attach_data['InstanceId'] = u'i-xyz'
        return attach_data
    elif (attach_type == self.A.DETACH_SUCCESS):
        return None
