Skip to content

Commit

Permalink
Merge pull request #553 from ylil93/master
Browse files Browse the repository at this point in the history
Fixed Github issues #538 #528
  • Loading branch information
Abhi Keshav authored Sep 18, 2017
2 parents 47ecf9b + 21ee793 commit 5c7608f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion sdk/cpp/core/src/netconf_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ shared_ptr<Entity> NetconfService::get(NetconfServiceProvider& provider, Entity&
}

//kill_session
bool NetconfService::kill_session(NetconfServiceProvider& provider, int session_id)
bool NetconfService::kill_session(NetconfServiceProvider& provider, unsigned int session_id)
{
YLOG_INFO("Executing kill-session RPC");

Expand Down
2 changes: 1 addition & 1 deletion sdk/cpp/core/src/netconf_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class NetconfService

std::shared_ptr<Entity> get(NetconfServiceProvider& provider, Entity& filter);

bool kill_session(NetconfServiceProvider& provider, int session_id);
bool kill_session(NetconfServiceProvider& provider, unsigned int session_id);

bool lock(NetconfServiceProvider& provider, DataStore target);

Expand Down
8 changes: 4 additions & 4 deletions sdk/cpp/samples/bgp_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void config_bgp(openconfig_bgp::Bgp* bgp)

//Commented because of XR 611 issue with OC identity
// auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->enabled = false;
// afi_safi->parent = bgp->global->afi_safis.get();
// bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand All @@ -48,7 +48,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
neighbor->config->local_as = 65001;
neighbor->config->peer_group = "IBGP";
//neighbor->config->peer_type = "INTERNAL";
//neighbor->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//neighbor->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
neighbor->parent = bgp->neighbors.get();
bgp->neighbors->neighbor.push_back(move(neighbor));

Expand All @@ -60,7 +60,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
peer_group->config->peer_as = 65001;
peer_group->config->local_as = 65001;
//peer_group->config->peer_type = "INTERNAL";
//peer_group->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//peer_group->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
peer_group->parent = bgp->peer_groups.get();
bgp->peer_groups->peer_group.push_back(move(peer_group));
}
Expand Down
8 changes: 4 additions & 4 deletions sdk/cpp/samples/bgp_restconf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void config_bgp(openconfig_bgp::Bgp* bgp)

//Commented because of XR 611 issue with OC identity
// auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->enabled = false;
// afi_safi->parent = bgp->global->afi_safis.get();
// bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand All @@ -55,7 +55,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
neighbor->config->local_as = 65001;
neighbor->config->peer_group = "IBGP";
//neighbor->config->peer_type = "INTERNAL";
//neighbor->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//neighbor->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
neighbor->parent = bgp->neighbors.get();
bgp->neighbors->neighbor.push_back(move(neighbor));

Expand All @@ -67,7 +67,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
peer_group->config->peer_as = 65001;
peer_group->config->local_as = 65001;
//peer_group->config->peer_type = "INTERNAL";
//peer_group->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//peer_group->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
peer_group->parent = bgp->peer_groups.get();
bgp->peer_groups->peer_group.push_back(move(peer_group));
}
Expand Down
8 changes: 4 additions & 4 deletions sdk/cpp/samples/bgp_routing_policy_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
bgp->global->config->router_id = "1.2.3.4";

auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VpnIpv4Unicast();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VpnIpv4Unicast();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->enabled = false;
afi_safi->parent = bgp->global->afi_safis.get();
bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand All @@ -47,7 +47,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
neighbor->config->peer_group = "IBGP";
neighbor->config->peer_type = "INTERNAL";
// neighbor->config->remove_private_as =
// openconfig_bgp_types::Private_As_Remove_All();
// openconfig_bgp_types::PRIVATEASREMOVEALL();
neighbor->parent = bgp->neighbors.get();
bgp->neighbors->neighbor.push_back(move(neighbor));

Expand All @@ -59,7 +59,7 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
peer_group->config->peer_as = 65001;
peer_group->config->local_as = 65001;
peer_group->config->peer_type = "INTERNAL";
//peer_group->config->remove_private_as = openconfig_bgp_types::Remove_Private_As_Option();
//peer_group->config->remove_private_as = openconfig_bgp_types::REMOVEPRIVATEASOPTION();
peer_group->parent = bgp->peer_groups.get();
bgp->peer_groups->peer_group.push_back(move(peer_group));
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/cpp/tests/test_crud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void config_bgp(openconfig_bgp::Bgp* bgp)
bgp->global->config->router_id = "1.2.3.4";

auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VPN_IPV4_UNICAST();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPN_IPV4_UNICAST();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->enabled = true;
afi_safi->parent = bgp->global->afi_safis.get();
bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand Down
8 changes: 4 additions & 4 deletions sdk/cpp/tests/test_opendaylight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ TEST_CASE("CreateODL")

//Commented because of XR 611 issue with OC identity
// auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3Vpn_Ipv4_Unicast();
// afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
// afi_safi->config->enabled = false;
// afi_safi->parent = bgp->global->afi_safis.get();
// bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand All @@ -85,7 +85,7 @@ TEST_CASE("CreateODL")
neighbor->config->local_as = 65001;
neighbor->config->peer_group = "IBGP";
//neighbor->config->peer_type = "INTERNAL";
//neighbor->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//neighbor->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
neighbor->parent = bgp->neighbors.get();
bgp->neighbors->neighbor.push_back(move(neighbor));

Expand All @@ -97,7 +97,7 @@ TEST_CASE("CreateODL")
peer_group->config->peer_as = 65001;
peer_group->config->local_as = 65001;
//peer_group->config->peer_type = "INTERNAL";
//peer_group->config->remove_private_as = openconfig_bgp_types::Private_As_Remove_All();
//peer_group->config->remove_private_as = openconfig_bgp_types::PRIVATEASREMOVEALL();
peer_group->parent = bgp->peer_groups.get();
bgp->peer_groups->peer_group.push_back(move(peer_group));

Expand Down
4 changes: 2 additions & 2 deletions sdk/cpp/tests/test_xml_subtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ bgp->global->config->as = 65172;
bgp->global->config->router_id = "1.2.3.4";

auto afi_safi = make_unique<openconfig_bgp::Bgp::Global::AfiSafis::AfiSafi>();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VPN_IPV4_UNICAST();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPN_IPV4_UNICAST();
afi_safi->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->afi_safi_name = openconfig_bgp_types::L3VPNIPV4UNICAST();
afi_safi->config->enabled = true;
afi_safi->parent = bgp->global->afi_safis.get();
bgp->global->afi_safis->afi_safi.push_back(move(afi_safi));
Expand Down
4 changes: 3 additions & 1 deletion ydkgen/api_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,12 +876,14 @@ def snake_case(input_text):
return snake_case.lower()


# capitalized input will not affected
def camel_case(input_text):
def _title(s):
if len(s) > 0 and s.startswith(s[0].upper()):
return s
return s.title()
return ''.join([_title(word) for word in input_text.split('-')])
result = ''.join([_title(word) for word in input_text.split('-')])
return ''.join([_title(word) for word in result.split('_')])


def escape_name(name):
Expand Down

0 comments on commit 5c7608f

Please sign in to comment.