def _check_hg_port_breakout(hybrid_group_name, port_id, br_mode):
    #Get Hybrid Group Object
    resp = hg_utils.get_hg(str(hybrid_group_name))
    assert len(resp) == 1
    for o in resp:
        assert o is not None
    obj = cps_object.CPSObject(obj=o)

    #Check if name is correct
    hg_name = nas_if.get_cps_attr(obj, hg_utils.hg_attr('id'))
    assert hg_name == str(hybrid_group_name)

    port_list = nas_if.get_cps_attr(obj, hg_utils.hg_attr('port'))
    for port_idx in port_list:
        port = port_list[port_idx]
        pr_id = port['port-id']
        if str(pr_id) == str(port_id):
            phy_mode = port['phy-mode']
            breakout_mode = port['breakout-mode']
            port_speed = port['port-speed']
            breakout_option = (breakout_mode, port_speed)
            breakout = nas_comm.yang.get_key(breakout_option,
                                             'yang-breakout-port-speed')
            assert str(breakout) == str(br_mode)
            break
def _check_hg_profile(hybrid_group_name, profile_name):
    #Get Hybrid Group Object
    resp = hg_utils.get_hg(str(hybrid_group_name))
    assert len(resp) == 1
    for o in resp:
        assert o is not None
    obj = cps_object.CPSObject(obj=o)

    #Check if name is correct
    hg_name = nas_if.get_cps_attr(obj, hg_utils.hg_attr('id'))
    assert hg_name == str(hybrid_group_name)

    #Check profile Type
    hg_profile = nas_if.get_cps_attr(obj, hg_utils.hg_attr('profile'))
    assert hg_profile == str(profile_name)
def _check_hg_support_on_platform():
    resp = hg_utils.get_hg()
    if len(resp) == 0:
        prRed("Hybrid Group is not supported on this platform. Aborting Test")
        return False
    return True