-
Notifications
You must be signed in to change notification settings - Fork 42
Improve power supply information in get_enviornment() #211
Conversation
try: | ||
power_supplies.get() | ||
except RpcError: | ||
# Not all platforms have support for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What platforms have support for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know... I only know it works for a QFX10k but it does not work in the qfx5110-48s-4c. I do not have access to other platforms to test that...
user@juniper> show chassis power
error: command is not valid on the qfx5110-48s-4c
According to https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/show-chassis-power.html this command is supported in the MX (same output), also
supported in the PTX (but the output is different) and EX9200
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, that tends to be very obscure... I check on MX and it is fine.
Okay, this seems to break the test case for the virtual chassis, as virtual chassis most probably don't have the power supply section. Can you please check @ckishimo? |
@@ -0,0 +1,4 @@ | |||
<power-usage-information> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckishimo if you add this file here, it means a device that does not have this capability, for example your qfx5110-48s-4c, does not error when retrieving this RPC & returns exactly this XML back. Is this correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mirceaulinic not sure I'm following... the qfx5110 does not have this capability but it does not error as the get()
is within the try...except
clause. The two files I committed are just to pass the failing tests... The qfx5110 will indeed fail when retrieving the RPC:
jnpr.junos.exception.RpcError: RpcError(severity: error, bad_element: None, message: command is not valid on the qfx5110-48s-4c)
I don't have other devices (ie: virtual chassis) to test this more extensively... 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agreed there's no good way to reproduce a RpcError using mock files.
This PR will improve the output of get_environment(), as the command
show chassis power
available in some platforms reports capacity and output per power supplyExample:
The output from get_environment() will be now:
Let me know. Thanks