def clone_rtcpath_update_rt_as(path, new_rt_as):
 assert (path and new_rt_as)
 if ((not path) or (path.route_family != RF_RTC_UC)):
  raise ValueError('Expected RT_NLRI path')
 old_nlri = path.nlri
 new_rt_nlri = RouteTargetMembershipNLRI(new_rt_as, old_nlri.route_target)
 return RtcPath(path.source, new_rt_nlri, path.source_version_num, pattrs=path.pathattr_map, nexthop=path.nexthop, is_withdraw=path.is_withdraw)

def clone_rtcpath_update_rt_as ( path , new_rt_as ) : assert ( path and new_rt_as ) if ( ( not path ) or ( path . route_family != RF_RTC_UC ) ) : raise ValueError ( 'Expected RT_NLRI path' ) old_nlri = path . nlri new_rt_nlri = RouteTargetMembershipNLRI ( new_rt_as , old_nlri . route_target ) return RtcPath ( path . source , new_rt_nlri , path . source_version_num , pattrs = path . pathattr_map , nexthop = path . nexthop , is_withdraw = path . is_withdraw )
clones given rt nlri path .