Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the dependency on netaddr #122

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions hardware/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import argparse
import fcntl
import ipaddress
import json
import os
import pprint
Expand All @@ -32,8 +33,6 @@
import uuid
import xml.etree.ElementTree as ET

from netaddr import IPNetwork

from hardware import areca
from hardware.benchmark import cpu as bm_cpu
from hardware.benchmark import disk as bm_disk
Expand Down Expand Up @@ -573,9 +572,10 @@ def find_element(xml, xml_spec, sys_subtype,
cidr = get_cidr(netmask)
hw_lst.append(
('network', name.text, 'ipv4-cidr', cidr))
net = (ipaddress.IPv4Interface('%s/%s' % (ipv4, cidr))
.network.network_address)
hw_lst.append(
('network', name.text, 'ipv4-network',
"%s" % IPNetwork('%s/%s' % (ipv4, cidr)).network))
('network', name.text, 'ipv4-network', str(net)))
except Exception as excpt:
sys.stderr.write('unable to get info for %s: %s\n'
% (name.text, str(excpt)))
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

pbr>=1.0 # Apache-2.0
six # MIT
ipaddress # PSF
netaddr # BSD
pexpect # ISC
numpy # BSD
pandas # BSD