Skip to content

Commit

Permalink
Clean up and fix missing references.
Browse files Browse the repository at this point in the history
During our refactoring, we forgot about a few references to for example
ConnectError and ManualReboot. Plus we forgot about removing a bunch of
unused imports.

Seems that there are not a lot of testers out there using the master
branch, because reboot was essntially broken.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information
aszlig committed Sep 4, 2014
1 parent 6151b44 commit 280f8d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions hetzner/reset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import socket
import time

from hetzner import ConnectError, ManualReboot


class Reset(object):
def __init__(self, server):
Expand Down
1 change: 0 additions & 1 deletion hetzner/robot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
import json
import logging

Expand Down
8 changes: 3 additions & 5 deletions hetzner/server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import os
import re
import time
import random
import socket
import string
import subprocess
import warnings
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 280f8d3

Please sign in to comment.