From 74a3e87de3f970e734cf8c9c1b9422744b6f1b0b Mon Sep 17 00:00:00 2001 From: kaiyou Date: Mon, 6 May 2019 14:57:38 +0200 Subject: [PATCH] Fix a couple syntax typos --- core/base/libs/socrate/socrate/system.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/base/libs/socrate/socrate/system.py b/core/base/libs/socrate/socrate/system.py index 64a87d15..b3b95012 100644 --- a/core/base/libs/socrate/socrate/system.py +++ b/core/base/libs/socrate/socrate/system.py @@ -2,8 +2,8 @@ import socket import tenacity -@retry(stop=tenacity.stop_after_attempt(100), - wait=tenacity.wait_random(min=2, max=5)) +@tenacity.retry(stop=tenacity.stop_after_attempt(100), + wait=tenacity.wait_random(min=2, max=5)) def resolve_hostname(hostname): """ This function uses system DNS to resolve a hostname. It is capable of retrying in case the host is not immediately available @@ -15,6 +15,6 @@ def resolve_address(address): """ This function is identical to ``resolve_host`` but also supports resolving an address, i.e. including a port. """ - hostname, *rest = address.resplit(":", 1) + hostname, *rest = address.rsplit(":", 1) ip_address = resolve_hostname(hostname) return ip_address + "".join(":" + port for port in rest)