def make_EnclosureGroupV200(associatedLIGs, name,
                            powerMode='RedundantPowerSupply'):
    """ Create an EnclosureGroupV200 dictionary

    Args:
        associatedLIGs:
            A sorted list of logical interconnect group URIs associated with
            the enclosure group.
        name:
            The name of the enclosure group.
        stackingMode:
            Stacking mode of the enclosure group. Currently only the Enclosure
            mode is supported. Values are 'Enclosure', 'MultiEnclosure',
            'None', or 'SwitchParis'.
        powerMode:
             Power mode of the enclosure group. Values are 'RedundantPowerFeed'
             or 'RedundantPowerSupply'.

    Returns: dict
    """
    ligUri = associatedLIGs['uri']
    icms = associatedLIGs['interconnectMapTemplate']['interconnectMapEntryTemplates']
    ligs = []
    # With the 200 API, the LIG uri can only be assigned if the LIG contains a
    # definition of the interconnect bay. I.E. if the LIG only has ICM 1 and 2
    # defined then 3 - 8 must be set to None. I.E:
    #    'interconnectBayMappings': [{'interconnectBay': 1,
    #                                 'logicalInterconnectGroupUri': '/rest/logical-interconnect-groups/f8371e33-6d07-4477-9b63-cf8400242059'},
    #                                {'interconnectBay': 2,
    #                                 'logicalInterconnectGroupUri': '/rest/logical-interconnect-groups/f8371e33-6d07-4477-9b63-cf8400242059'}]}
    #                                {'interconnectBay': 3,
    #                                 'logicalInterconnectGroupUri': None},
    #                                {'interconnectBay': 4,
    #                                 'logicalInterconnectGroupUri': None},
    #                                 ...
    for N in range(1, 9):
        if len(icms) > N:
            ligs.append({'interconnectBay': N,
                         'logicalInterconnectGroupUri': None})
        else:
            ligs.append({'interconnectBay': N,
                         'logicalInterconnectGroupUri': ligUri})
    return {
        'name': name,
        'type': 'EnclosureGroupV200',
        'stackingMode': 'Enclosure',
        'powerMode': powerMode,
        'enclosureCount': 1,
        'enclosureTypeUri': "/rest/enclosure-types/c7000",
        'interconnectBayMappingCount': 8,
        'interconnectBayMappings': ligs
        }
dataset/ETHPy150Open HewlettPackard/python-hpOneView/hpOneView/common.py/make_EnclosureGroupV200/swapped operands of `>`