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

isisd: Command "show isis interface IFNAME json" displays all interfaces's circuit id. #17158

Closed
wants to merge 1 commit into from

Conversation

baozhen-H3C
Copy link
Contributor

@baozhen-H3C baozhen-H3C commented Oct 18, 2024

The change is only to skip showing circuits that do not have any interfaces assigned.

@frrbot frrbot bot added the isis label Oct 18, 2024
@baozhen-H3C baozhen-H3C force-pushed the 202410180184 branch 5 times, most recently from cf57446 to 4430811 Compare October 18, 2024 09:35
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

Could you put the outputs before/after in the commit message?

isisd/isisd.c Outdated Show resolved Hide resolved
@@ -955,6 +955,8 @@ void isis_circuit_print_json(struct isis_circuit *circuit,
char buf_prx[INET6_BUFSIZ];
char buf[255];

json_object_int_add(json, "circuit", circuit->circuit_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

why add this value a second time, with a new key - isn't it being added just below with "circuit-id"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to print the circuit_id only when printing a specific interface, if this modification is allowed.

@baozhen-H3C baozhen-H3C force-pushed the 202410180184 branch 2 times, most recently from 09dc643 to 0a845f7 Compare October 21, 2024 03:00
@ton31337
Copy link
Member

@baozhen-H3C please put the description in the commit, not in the PR's description.

@ton31337
Copy link
Member

So, is this change only to skip showing circuits that do not have any interfaces assigned?

@baozhen-H3C
Copy link
Contributor Author

@ton31337 Yes, it now seems unnecessary.Perhaps what I'm doing is pointless.

@ton31337
Copy link
Member

@ton31337 Yes, it now seems unnecessary.Perhaps what I'm doing is pointless.

TBH, this is kinda of a breaking change (at some level).

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

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

waiting on the other comments, otherwise good

@github-actions github-actions bot added the rebase PR needs rebase label Oct 23, 2024
… ID of all interfaces

1.before the commit
if the interface exists:
sonic# show isis interface lo json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":13
       },
       {
         "circuit":14
       },
       {
         "circuit":0,
         "interface":{
           "name":"lo",
           "state":"Up",
           "is-passive":"passive",
           "circuit-id":"0x0",
           "type":"loopback",
           "level":"L1",
           "levels":[
             {
               "level":"L1",
               "metric":10
             }
           ],
           "ip-prefix":{
             "ip":"7.7.7.7/32"
           }
         }
       }
     ]
   }
 ]
}

if the interface doesn't exist:
sonic# show isis interface abc json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":13
       },
       {
         "circuit":14
       },
       {
         "circuit":0
       }
     ]
   }
 ]
}

2.after the commit
if the interface exists:
sonic# show isis interface lo json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
       {
         "circuit":0,
         "interface":{
           "name":"lo",
           "state":"Up",
           "is-passive":"passive",
           "circuit-id":"0x0",
           "type":"loopback",
           "level":"L1",
           "levels":[
             {
               "level":"L1",
               "metric":10
             }
           ],
           "ip-prefix":{
             "ip":"7.7.7.7/32"
           }
         }
       }
     ]
   }
 ]
}

if the interface doesn't exist:
sonic# show isis interface abc json
{
 "areas":[
   {
     "area":"10",
     "circuits":[
     ]
   }
 ]
}

Signed-off-by: baozhen-H3C <[email protected]>
@riw777
Copy link
Member

riw777 commented Dec 17, 2024

seems like this is pointless now (?) ... I'll set it to autoclose, please comment if this is still needed

@riw777
Copy link
Member

riw777 commented Dec 17, 2024

@frrbot autoclose in 1 month

@frrbot frrbot bot added the autoclose label Dec 17, 2024
@baozhen-H3C
Copy link
Contributor Author

seems like this is pointless now (?) ... I'll set it to autoclose, please comment if this is still needed

It's ok, let it autoclose.

@frrbot frrbot bot removed the autoclose label Dec 18, 2024
@frrbot
Copy link

frrbot bot commented Dec 18, 2024

This issue will no longer be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants