-
Notifications
You must be signed in to change notification settings - Fork 109
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
find nic_name automatically if misspecified #29
base: development
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## development #29 +/- ##
==============================================
- Coverage 40.67% 40.27% -0.4%
==============================================
Files 40 40
Lines 2611 2622 +11
==============================================
- Hits 1062 1056 -6
- Misses 1549 1566 +17
Continue to review full report at Codecov.
|
def get_nic_name_from_system(): | ||
import re | ||
import subprocess | ||
process = subprocess.Popen("ip route get 8.8.8.8".split(), |
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.
Does this assume that the node has internet access? And it's not really portable as it requires ip
to exist.
And pinging a Google DNS is not the most reliable way to figure out the network interface.
|
||
# if the network card name is not a valid one an ecxeption will be raised | ||
# and the method get_nic_name_from_system will discover a valid card name | ||
try: |
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 like the sentiment of your functionality, but I assumed that most users would call the nic_name_to_host function and catch the exception themselves in case they need to try more nic names because they are different across the cluster (which is usually not the case).
Hey Arber, |
Added functionality to catch exceptions when the network card name is misspecified or is None. This may be useful in cluster environments with several submission nodes in cases when the network interfaces are different among them and the login node