Automatically determine IPv4 address #970
Conversation
|
Following up with Issue: #971 |
Codecov Report
@@ Coverage Diff @@
## hawksbeard #970 +/- ##
==============================================
- Coverage 49.85% 41.04% -8.81%
==============================================
Files 67 67
Lines 8351 8366 +15
==============================================
- Hits 4163 3434 -729
- Misses 4188 4932 +744
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## hawksbeard #970 +/- ##
=============================================
Coverage ? 76.12%
=============================================
Files ? 67
Lines ? 8544
Branches ? 0
=============================================
Hits ? 6504
Misses ? 2040
Partials ? 0
Continue to review full report at Codecov.
|
michwill
left a comment
There was a problem hiding this comment.
Great! A much needed addition.
Not very decentralized, but that's probably ok
nucypher/cli/characters/ursula.py
Outdated
| is_valid_address = False | ||
| if rest_host is not None and not force: | ||
| is_valid_address = click.confirm(f"Is this the public-facing IPv4 address ({rest_host}) you want to use for Ursula?") | ||
| if not is_valid_address or rest_host is not None: |
There was a problem hiding this comment.
Bug: If rest_host is an actual IP address and force is true -> this branch is enterred and a RuntimeError is thrown.
There was a problem hiding this comment.
@tuxxy what about something like:
rest_host = actions.get_external_ip()
if rest_host is None and force:
# could not determine ip automatically but force is set
raise RuntimeError("There was an error automatically determining the IP address")
else:
is_valid_address = rest_host is not None and force # assume valid since successfully determined and force set to true
if rest_host is not None and not force:
# confirm validity since not forced
is_valid_address = click.confirm(f"Is this the public-facing IPv4 address ({rest_host}) yo\
u want to use for Ursula?")
if not is_valid_address:
# unable to determine valid ip, prompt user for it
rest_host = click.prompt("Please enter Ursula's public-facing IPv4 address here:")|
Needs rebase over #951 |
tests/cli/ursula/test_run_ursula.py
Outdated
|
|
||
| user_input = f'Y\n{INSECURE_DEVELOPMENT_PASSWORD}\n{INSECURE_DEVELOPMENT_PASSWORD}' | ||
|
|
||
| breakpoint() |
08cca0c to
dbb1912
Compare
…4 address