This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
solutions-tsg-scripts/roles/dogroups/files/dogroups.fact

30 lines
664 B
Python

#!/usr/bin/python
import json
import os
import re
def get_IPMB_location():
cmdtodo = 'ipmitool raw 0x2e 0x32 0x13 0x5f 0x00'
numStr = None
optdl = os.popen(cmdtodo)
strlocation = optdl.read()
if not len(strlocation):
optdl.close()
return None
optdl.close()
infos = re.split(' |\n',strlocation)
if infos[5] == '90':
numStr = 'zero'
if infos[5] == '80':
numStr = 'one'
if infos[5] == '88':
numStr = 'two'
if infos[5] == '98':
numStr = 'three'
if numStr == -1:
return None
return json.dumps(numStr)
if __name__ == '__main__':
print get_IPMB_location()