diff --git a/hetzner/reset.py b/hetzner/reset.py index e8e1d38..c7208f7 100644 --- a/hetzner/reset.py +++ b/hetzner/reset.py @@ -1,6 +1,8 @@ import socket import time +from hetzner import ConnectError, ManualReboot + class Reset(object): def __init__(self, server): diff --git a/hetzner/robot.py b/hetzner/robot.py index fbd2d1e..e9e7984 100644 --- a/hetzner/robot.py +++ b/hetzner/robot.py @@ -1,4 +1,3 @@ -import re import json import logging diff --git a/hetzner/server.py b/hetzner/server.py index 327dad1..441ec48 100644 --- a/hetzner/server.py +++ b/hetzner/server.py @@ -1,8 +1,6 @@ import os import re -import time import random -import socket import string import subprocess import warnings @@ -17,7 +15,7 @@ except ImportError: from urllib.parse import urlencode -from hetzner import RobotError, ManualReboot, ConnectError +from hetzner import RobotError from hetzner.rdns import ReverseDNS, ReverseDNSManager from hetzner.reset import Reset from hetzner.util import addr @@ -332,14 +330,14 @@ def get_ip_range(self): Return the smallest and biggest possible IP address of the current subnet. """ - convert = util.ipv6_bin2addr if self.is_ipv6 else util.ipv4_bin2addr + convert = addr.ipv6_bin2addr if self.is_ipv6 else addr.ipv4_bin2addr return convert(self.numeric_range[0]), convert(self.numeric_range[1]) def __contains__(self, addr): """ Check whether a specific IP address is within the current subnet. """ - numeric_addr = util.parse_ipaddr(addr, self.is_ipv6) + numeric_addr = addr.parse_ipaddr(addr, self.is_ipv6) return self.numeric_range[0] <= numeric_addr <= self.numeric_range[1] def get_ip(self, addr):