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
Dynamic mountpoint detection -- new version #54
Dynamic mountpoint detection -- new version #54
Conversation
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
@@ -1604,14 +1615,14 @@ def _setOptions(self, options): | |||
|
|||
@property | |||
def free(self): | |||
if self._mountpoint: | |||
# If self._mountpoint is defined, it means this tmpfs mount | |||
if self.systeMountpoint: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Watch out for spelling mistakes!..."systeMountpoint". pylint will definitely catch these kinds of things.
Other than minor inline comments, that looks good to me. And a very nice improvement to our filesystem code, too. |
Current format._mountpoint attribute for "active" mountpoints is being replaced with property format.systemMountpoint that returns current mountpoint based on system information (cached information from /proc/mounts and /proc/self/mountinfo) Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Handling nodev filesystems was originally part of getActiveMounts method that is no longer needed. Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
Tests for new dynamic mountpoint detection using MountsCache Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
be5aa4d
to
6532cc4
Compare
I made few changes based on comments by mulkieran and bcl but after force pushing them most of the comments disappeared... |
Still looks good to me. FWIW, I ran a quick profile on the md5_file() method on my /proc/mounts and it's the read() method that chews up the bulk of the time, with updating the hash a distant second. And if we check whether there has been a change this way we just can't get away from reading those bits. Reading it in smaller chunks makes no difference...reading it in one big step doubles the time it takes. |
Other than the neat-pick above this still looks good to me. |
Docstring added. Pushed. |
New version of previous pull request -- #47
Changes: