示例#1
0
    def _get_members(self, **properties):
        """Get a list of members from the pool definition"""
        try:
            members = (properties['membersReference'].get('items', []))
        except KeyError:
            return list()

        return [IcrPoolMember(pool=self, **member) for member in members]
示例#2
0
def test_create_bigip_member(pool, bigip_members):
    """Test the creation of PoolMember from BIG-IP data."""
    member_cfg = bigip_members[0]

    pp(bigip_members)
    pp(member_cfg)
    # pdb.set_trace()
    member = IcrPoolMember(pool=pool, **member_cfg)

    assert member

    # Test data
    assert member.data
    assert member.data['name'] == "192.168.200.2:80"
    assert member.data['ratio'] == 1
    assert member.data['connectionLimit'] == 0
    assert member.data['priorityGroup'] == 0
    assert member.data['session'] == "user-enabled"
    assert not member.data['description']