-
Notifications
You must be signed in to change notification settings - Fork 242
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
utils_misc: Reorg disk related APIs into utils_disk #2103
base: master
Are you sure you want to change the base?
Conversation
43de837
to
3c5ffd6
Compare
new_disk_vol_name()
to utils_disknew_disk_vol_name()
to utils_disk
This pull request introduces 12 alerts when merging 3c5ffd6 into 3852a5c - view on LGTM.com new alerts:
|
3c5ffd6
to
01e1884
Compare
7a34ecb
to
3093a9d
Compare
This pull request introduces 1 alert when merging 3093a9d into 3852a5c - view on LGTM.com new alerts:
|
3093a9d
to
0dee3e5
Compare
This pull request introduces 1 alert when merging 0dee3e5 into cb277eb - view on LGTM.com new alerts:
|
0dee3e5
to
503680c
Compare
new_disk_vol_name()
to utils_disk
@vivianQizhu I have worked to reorganize disk related methods to avoid circular imports and to cleanup utils_misc.py. I have moved most of your code in this reorganization work, I would request for your review and acknowledgement. Thanks! |
503680c
to
03fe125
Compare
This pull request introduces 1 alert when merging 03fe125 into 509ca09 - view on LGTM.com new alerts:
|
03fe125
to
34b4607
Compare
@luckyh request for your review. This is part of cleaning up utlils_misc.py, there is no logical changes I have moved the disk related APIs to organise it. |
@balamuruhans ok, I see there are several problems been solved in this PR, so let's put them into individual commits, thanks. |
34b4607
to
07144ed
Compare
This pull request introduces 2 alerts and fixes 1 when merging 07144ed into 5c83fe5 - view on LGTM.com new alerts:
fixed alerts:
|
07144ed
to
25afa10
Compare
This pull request introduces 1 alert and fixes 1 when merging 25afa10 into 5c83fe5 - view on LGTM.com new alerts:
fixed alerts:
|
@luckyh I have separated out commits and included @bssrikanth's patch work with this PR to avoid CI failure/checks. request for your review. |
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.
@balamuruhans I like this improvement, but we should take care about these things for preventing it breaking our current and future testing, let's consider more about that, thanks!
if ostype == "windows": | ||
return format_windows_disk(session, did, mountpoint, size, fstype) | ||
return format_linux_disk(session, did, all_disks_did, partition, | ||
mountpoint, size, fstype) |
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.
We should take care of the above 5 functions for moving out them from this module since there are several test scripts using them currently.
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.
@bssrikanth is working on some more disk related functions into utils_disk with #2148. I thought of getting in this first and he can rebase the PR #2148.
25afa10
to
8b35297
Compare
This pull request introduces 1 alert when merging 8b35297 into 3f08daa - view on LGTM.com new alerts:
|
@luckyh Thanks for reviewing, the reason that I forgot why I moved some APIs from gluster.py to utils_disk.py is to avoid the above cyclic import issue, If the APIs file_exists() and glusterfs_mount() to utils_disk.py this can be fixed. If you think on any other solution please help me on it. |
8b35297
to
a4058a7
Compare
@luckyh could you help to review the changes. Thanks! |
@@ -204,80 +201,6 @@ def gluster_brick_delete(brick_path, session=None): | |||
logging.error("Not able to delete brick folder %s", details) | |||
|
|||
|
|||
@error_context.context_aware | |||
def gluster_vol_create(vol_name, hostname, brick_path, force=False, session=None): |
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.
If you just want to avoid circular imports, it's better to look for calling alternatives rather than move these things out
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.
I could not get about this idea, can you help me to explain it ?
5170a81
to
609f52f
Compare
Reorganise disk related method to utils_disk and break circular imports caused with respect to disk related APIs in utils_misc and gluster to utils_disk for better work flow. Rename utils_disk.py to disk.py Signed-off-by: Srikanth Aithal <[email protected]> Signed-off-by: Balamuruhan S <[email protected]>
609f52f
to
a1d965b
Compare
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.
LGTM, minor, change commit heading to Reorg disk related APIs
otherwords, avoid utils_disk
from commit heading, as anyways it has been renamed to disk.py
Reorganise disk related method to utils_disk and break circular
imports caused with respect to disk related APIs in utils_misc and
gluster, move some of storage apis to utils_disk and utils_storage
for better work flow. Rename utils_disk.py to disk.py
Signed-off-by: Srikanth Aithal [email protected]
Signed-off-by: Balamuruhan S [email protected]