-
Notifications
You must be signed in to change notification settings - Fork 23
CA-402814: rationalise canonicalisation of device path #201
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .idea | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -289,9 +289,9 @@ def getDiskBlockSize(dev): | |
| dev = '/dev/' + dev | ||
| if isDeviceMapperNode(dev): | ||
| return getDiskBlockSize(getDeviceSlaves(dev)[0]) | ||
| if dev.startswith("/dev/"): | ||
| dev = re.match("/dev/(.*)", dev).group(1) | ||
| dev = dev.replace("/", "!") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What specifically was wrong with the original code? The same pattern is used in several places in the installer (e.g. in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well for starters injecting
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently there are/were some devices having path separators in their name. And apparently the But @rosslagerwall point still remains, the same code is spread in different places so if one is broken why the others are fine? I think adding
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And probably an exists check as well |
||
|
|
||
| realpath = os.path.realpath(dev) | ||
| dev = os.path.basename(realpath) | ||
|
Comment on lines
+293
to
+294
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the code removing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, by using realpath to reduce that down to the actual device rather than the symlink, which should not have path separators in its name.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some device name have path separators in their names |
||
| return int(__readOneLineFile__("/sys/block/%s/queue/logical_block_size" | ||
| % dev)) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.