Skip to content

Instantly share code, notes, and snippets.

@etrepum
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etrepum/0a57470f371d489cf2f3 to your computer and use it in GitHub Desktop.
Save etrepum/0a57470f371d489cf2f3 to your computer and use it in GitHub Desktop.
INPUT_TEXT="""\
Processor : Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz (24 cores/threads)
Memory : 81877MB
Controller Slot : 0
BIOS : 3.0a 11/12/2013 3.1
IPMI FW rev : 2.20
Canister firmware : 2.2.26
Canister firmware date : Feb 5 2013 20:54:00
"""
data = {}
for line in INPUT_TEXT.splitlines():
key, delimiter, value = line.partition(':')
if delimiter:
data[key.strip()] = value.strip()
info = ['IPMI FW rev','BIOS','Canister firmware','Memory','Controller Slot']
for key in info:
print('{0}: {1}'.format(key, data[key]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment