-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adds esi node network show command #83
Conversation
The output is a bit ugly; |
esiclient/v1/node_network.py
Outdated
return ["Node", "Node UUID", "Node Ports"], [ | ||
node_network["node"].name, | ||
node_network["node"].id, | ||
node_ports, |
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 if we did this?
node_ports, | |
node_ports if parsed_args.formatter == "json" else json.dumps(node_ports, indent=2), |
That gets us:
+-------+--------------------------------------------------------------------+
| Field | Value |
+-------+--------------------------------------------------------------------+
| Node | MOC-R4PAC22U33-S3A |
| UUID | a94f0a86-4b37-4cf1-bd53-3107d60e72f8 |
| Ports | [ |
| | { |
| | "mac_address": "a8:99:69:ae:d6:db", |
| | "baremetal_port_uuid": "e043ce6d-21b1-439f-9d3b-488994b85cbb", |
| | "network_port": { |
| | "name": "esi-MOC-R4PAC22U33-S3A-hypershift-pool", |
| | "uuid": "8646e75a-2b30-4eb4-aef8-da35e8c143ca", |
| | "fixed_ips": [ |
| | "10.219.1.168" |
| | ] |
| | }, |
| | "network": { |
| | "name": "hypershift-pool", |
| | "uuid": "610f12a1-10be-4dd7-92fc-9d6f63a9227a", |
| | "vlan_id": 464 |
| | } |
| | }, |
| | { |
| | "mac_address": "a8:99:69:ae:d6:de", |
| | "baremetal_port_uuid": "c1d44f2a-3754-4a12-a394-3e20b44cff03" |
| | } |
| | ] |
+-------+--------------------------------------------------------------------+
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.
Oh, I like this a lot - good idea!
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'll probably make it a bit more exclusionary, since I don't think we want this formatting for, say, csv output.
aa10953
to
58967b1
Compare
I've made the suggested changes - let me know what you think! |
No description provided.