Skip to content
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

Fixed key error issue in file-disks/disk.py #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion file-disks/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,16 @@ def InitBlockLayout(self):
self.blockInfoList.append((track, angle + (angleOffset * skew), block))
self.tracksBeginEnd[track] = (pblock, block)
self.maxBlock = pblock

# print 'MAX BLOCK:', self.maxBlock

# adjust angle to starting position relative
self.maxBlockToAngleMap = max(self.blockToAngleMap)
for i in self.blockToAngleMap:
for block in self.addr.split(","):
if int(block) > self.maxBlockToAngleMap:
print("Error: The requested block address %s is greater than the maximum block %d available"%(block,self.maxBlockToAngleMap))
sys.exit(1)
self.blockToAngleMap[i] = (self.blockToAngleMap[i] + 180) % 360

# print 'btoa map', self.blockToAngleMap
Expand All @@ -338,7 +344,7 @@ def MakeRequests(self, addr, addrDesc):
for i in range(numRequests):
tmpList.append(int(random.random() * maxRequest) + minRequest)
return tmpList
else:
else:
return addr.split(',')

#
Expand Down