Skip to content

Commit

Permalink
Updated gen4.py
Browse files Browse the repository at this point in the history
Workaround issue in IDrac 4.xx and 5.xx whereby the ethernet REDFISH schema is returning differently than iDRAC 3.xx
  • Loading branch information
indigo360 authored Feb 4, 2022
1 parent 118f7a5 commit bad154d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions gen4.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""gen4.py"""
# _author_ = Brian Shorland <bshorland@bluecatnetworks.com>
# _version_ = 1.04
# _version_ = 1.05

import json
import argparse
Expand Down Expand Up @@ -362,10 +362,9 @@ def main():
cprint("{:<15}{:<18} {:<10}{:<16}{:<16} ".format("Port", "MAC", "Status", "IPv4 Address", "Network Mask"))
cprint("{:<15}{:<18} {:<10}{:<16}{:<16} ".format("--------------", "-----------------", "---------", "---------------", "---------------"))
for nic, details in d['Network Ports Rear'].items():
try:
if "ip" in details.keys():
cprint("{:<15}{:<18} {:<10}{:<16}{:<16} ".format(nic, details['mac'], details['status'], details['ip'], details['mask']))
except:
if "mac" in details.keys():
cprint("{:<15}{:<18} {:<10}{:<16}{:<16} ".format(nic, details['mac'], details['status'], "", ""))

if __name__ == "__main__":
main()
else:
cprint("{:<15}{:<18} {:<10}{:<16}{:<16} ".format(nic, "NA", "NA", "NA", "NA"))

0 comments on commit bad154d

Please sign in to comment.