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
mgr: use ipv4 default when ipv6 was disabled #28246
Conversation
I do not like the usage of the |
src/pybind/mgr/dashboard/module.py
Outdated
@@ -25,6 +26,12 @@ | |||
|
|||
from .services.sso import load_sso_db | |||
|
|||
ip_addrs = subprocess.check_output(["ip","addr"]) |
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 vote to use a different solution, e.g. by using procfs.
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.
hi, @votdev what's the advantage of procfs?
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'm agreeing with Volker here that calling an external program is not my preferred solution.
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.
Also this is the wrong place for this if statement, because it's part of the dashboard configuration. Instead it should be located somewhere in _configure()
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.
A Python "universal" solution would be preferable here.
Otherwise part of it will degrade into a `if (os_platform == .....) ... else .... " version
src/pybind/mgr/dashboard/module.py
Outdated
@@ -25,6 +26,12 @@ | |||
|
|||
from .services.sso import load_sso_db | |||
|
|||
ip_addrs = subprocess.check_output(["ip","addr"]) |
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.
Also this is the wrong place for this if statement, because it's part of the dashboard configuration. Instead it should be located somewhere in _configure()
Relates to #26635 |
#26635 may need be reverted, wait_for_occupied_port check is right to check the port. |
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.
Additionally to what other said: Imho this hsould be part of the MgrModule
implementation instead of adding this code to every module extending MgrModule
hi, @votdev @sebastian-philipp @jan--f thanks for your reviews, code modified, please review again |
Maybe something like this will work? Have not tested how it behaves on a IPv4 only system.
|
76a4b9c
to
7d81117
Compare
@votdev not work too |
Hi, reviewers, now we have two function to check whether ipv6 enabled, what's your proposition,socket or netifaces, i think netifaces is more simple,no need to create a socket, but it requires new dependence
|
I'm ok with both of them. ( @smithfarm is |
i am in favor of the first solution. and the reason is that it has less dependencies. and we can improve it a little bit: import contextlib
# ...
def is_ipv6_enabled():
try:
sock = socket.socket(socket.AF_INET6)
with contextlib.closing(sock):
sock.bind(("::1", 0))
return True
except (AttributeError, socket.error) as e:
return False changelog:
[0]
|
I grepped the Ceph codebase for UPDATE: On a single-node nautilus cluster installed from RPMs, there is no netifaces (python-netifaces, python3-netifaces) at all, so I'd say the short answer is: "no". |
hi, reviewers, according your advises, ipv6 check with socket was commit, please review, thanks |
3c4281b
to
350f764
Compare
hi reviewers need review again,ths! |
jenkins retest this please |
Fixes: https://tracker.ceph.com/issues/40023 Signed-off-by: kungf <yang.wang@easystack.cn>
jenkins test dashboard |
the valgrind failure is a known issue tracked by http://tracker.ceph.com/issues/38403, and it should be addressed by #28397 |
Fixes: https://tracker.ceph.com/issues/40023
Signed-off-by: kungf yang.wang@easystack.cn