Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization for not building tree when the targetURI is not supported #182

Merged
merged 8 commits into from
Oct 17, 2019
6 changes: 6 additions & 0 deletions src/translib/intf_cmn.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ func (app *IntfApp) getSpecificIfVlanAttr(targetUriPath *string, ifKey *string,
if e != nil {
return true, e
}
if accessVlanName == nil {
return true, nil
}
vlanName := *accessVlanName
vlanIdStr := vlanName[len("Vlan"):len(vlanName)]
vlanId, err := strconv.Atoi(vlanIdStr)
Expand Down Expand Up @@ -933,6 +936,9 @@ func (app *IntfApp) processGetSpecificIntf(dbs [db.MaxDB]*db.DB, targetUriPath *
}

ifInfo := intfObj.Interface[ifKey]
if *app.ygotTarget != ifInfo || *app.ygotTarget != ifInfo.Config || *app.ygotTarget != ifInfo.State {
return GetResponse{Payload: payload}, errors.New("Requested get type not supported!")
}
Copy link
Collaborator

@Tejaswi-Goel Tejaswi-Goel Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinejose91 This change might cause issue for following Get request targets:

  • OpenconfigInterfaces_Interfaces_Interface_Aggregation_State
  • OpenconfigInterfaces_Interfaces_Interface_Ethernet_SwitchedVlan_State

Can you please check and confirm?

Copy link
Author

@justinejose91 justinejose91 Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. Could you add those cases in port-channel pull-request? Currently, we don't support container level get, like switched-vlan/state. What we support is, attribute level or top level. If we support it, yes, we need to add those statements.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, we need to add those cases in a map and handle it. That would be better handling.

app.processBuildTree(ifInfo, &ifKey)

if *app.ygotTarget == ifInfo {
Expand Down