mirror of https://github.com/nucypher/nucypher.git
Respond to RFCs for PR #2462
parent
4f871f827f
commit
1b60b813dd
|
@ -359,6 +359,7 @@ def run(general_config, character_options, config_file, interactive, dry_run, pr
|
|||
dev_mode = character_options.config_options.dev
|
||||
|
||||
if prometheus and not metrics_port:
|
||||
# Require metrics port when using prometheus
|
||||
raise click.BadOptionUsage(option_name='metrics-port',
|
||||
message='--metrics-port is required when using --prometheus')
|
||||
|
||||
|
@ -371,7 +372,6 @@ def run(general_config, character_options, config_file, interactive, dry_run, pr
|
|||
|
||||
prometheus_config: 'PrometheusMetricsConfig' = None
|
||||
if prometheus and not dev_mode:
|
||||
# ensure metrics port is provided
|
||||
# Locally scoped to prevent import without prometheus explicitly installed
|
||||
from nucypher.utilities.prometheus.metrics import PrometheusMetricsConfig
|
||||
prometheus_config = PrometheusMetricsConfig(port=metrics_port,
|
||||
|
@ -386,8 +386,6 @@ def run(general_config, character_options, config_file, interactive, dry_run, pr
|
|||
if ip_checkup and not dev_mode:
|
||||
perform_startup_ip_check(emitter=emitter, ursula=URSULA, force=force)
|
||||
|
||||
# TODO: should we just not call run at all for "dry_run"
|
||||
# RE: That might make the some tests less accurate
|
||||
try:
|
||||
URSULA.run(emitter=emitter,
|
||||
start_reactor=not dry_run,
|
||||
|
|
|
@ -139,8 +139,8 @@ def get_external_ip_from_known_nodes(known_nodes: FleetSensor,
|
|||
for node in sample:
|
||||
ip = __request(url=node.rest_url())
|
||||
if ip:
|
||||
log.info(f'Fetched external IP address from randomly selected known node(s).')
|
||||
return ip
|
||||
log.info(f'Fetched external IP address ({ip}) from randomly selected known node(s).')
|
||||
return ip
|
||||
|
||||
|
||||
def get_external_ip_from_centralized_source(log: Logger = IP_DETECTION_LOGGER) -> Union[str, None]:
|
||||
|
@ -148,7 +148,7 @@ def get_external_ip_from_centralized_source(log: Logger = IP_DETECTION_LOGGER) -
|
|||
endpoint = 'https://ifconfig.me/'
|
||||
ip = __request(url=endpoint)
|
||||
if ip:
|
||||
log.info(f'Fetched external IP address from centralized source ({endpoint}).')
|
||||
log.info(f'Fetched external IP address ({ip}) from centralized source ({endpoint}).')
|
||||
return ip
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue