def define_san(sto, name, san_list, conn_list, append, hostos, lun, del_vol):

    volumes = sto.get_attachable_volumes()
    vol = None
    for volume in volumes['members']:
        if volume['name'] == name:
            vol = volume

    if not vol:
        print('Error, could not locate attachable volume:', name)
        sys.exit(2)

    if lun:
        lun_type = 'Manual'
    else:
        lun_type = 'Auto'

    net_ids = []
    conn = json.loads(open(conn_list).read())
    for item in conn:
        if item['functionType'] == 'FibreChannel':
            net_ids.append(item['id'])

    if not net_ids:
        print('Error, cound not locate FibreChannel connections to attach'
              ' volumes')
        sys.exit()

    paths = []
    for nid in net_ids:
        paths.append(hpov.common.make_StoragePathV2(storageTargetType='Auto',
                                                    storageTargets=[],
                                                    connectionId=nid,
                                                    isEnabled=True))

    vols = hpov.common.make_VolumeAttachmentV2(lun=None,
                                               lunType=lun_type,
                                               volumeUri=vol['uri'],
                                               volumeStoragePoolUri=vol['storagePoolUri'],
                                               volumeStorageSystemUri=vol['storageSystemUri'],
                                               storagePaths=paths)

    san_storage = hpov.common.make_SanStorageV3(HOST_OS[hostos], True, vols)

    if append:
        data = json.loads(open(san_list).read())
        if data not in 'volumeAttachments':
            print('Error, can not locate exsisting volumeAttachments to '
                  'append')
            sys.exit(3)
        vol_attach = data['volumeAttachments']
        vol_attach.append(vols)
    else:
        data = san_storage
    f = open(san_list, 'w')
    out = json.dumps(data, indent=4)
    f.write(out)
    f.close()
dataset/ETHPy150Open HewlettPackard/python-hpOneView/examples/scripts/define-san-storage-list.py/define_san/swapped operands of `not in`