Created
February 11, 2016 19:11
-
-
Save WaltHP/b33f65bc1fe858739804 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def process_lun_id(lun_id): | |
| if isinstance(lun_id, list): | |
| processed = [] | |
| for x in lun_id: | |
| if x > 255: | |
| val = hex(x) | |
| length = 18-len(val) | |
| for i in range(length): | |
| val+='0' | |
| processed.append(val) | |
| else: | |
| processed.append(x) | |
| return processed | |
| else: | |
| if lun_id < 255: | |
| return lun_id | |
| else: | |
| processed = hex(lun_id) | |
| length = 18-len(processed) | |
| for i in range(length): | |
| processed+='0' | |
| return processed | |
| for lun in range(0, 65536): | |
| lun_id = process_lun_id(lun) | |
| print "LUN(%s) = lun-%s" % (lun, lun_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment