version 2.1.fb1-1

Signed-off-by: Andy Grover <agrover@redhat.com>
This commit is contained in:
Andy Grover 2011-12-06 17:30:27 -08:00
parent cdb3c35b73
commit 1e0f349e1d
6 changed files with 17 additions and 104 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/rtslib-1.99.1.git644eece.tar.gz
/v2.1.fb1

View File

@ -1,13 +0,0 @@
diff --git a/rtslib/__init__.py b/rtslib/__init__.py
index b59eba6..7de59fb 100644
--- a/rtslib/__init__.py
+++ b/rtslib/__init__.py
@@ -28,7 +28,7 @@ from tcm import FileIOStorageObject, IBlockStorageObject
from tcm import PSCSIBackstore, RDDRBackstore, RDMCPBackstore
from tcm import PSCSIStorageObject, RDDRStorageObject, RDMCPStorageObject
-__version__ = 'GIT_VERSION'
+__version__ = '644eece'
__author__ = "Jerome Martin <jxm@risingtidesystems.com>"
__url__ = "http://www.risingtidesystems.com"
__description__ = "API for RisingTide Systems generic SCSI target."

View File

@ -1,27 +0,0 @@
commit 25f651279f95a29682bee72b56a6730a91d17f27
Author: Andy Grover <agrover@redhat.com>
Date: Wed Aug 17 16:08:15 2011 -0700
change spec_dir to /var/lib/target
Signed-off-by: Andy Grover <agrover@redhat.com>
diff --git a/rtslib/node.py b/rtslib/node.py
index 413781f..6ce4dee 100644
--- a/rtslib/node.py
+++ b/rtslib/node.py
@@ -25,12 +25,12 @@ from utils import fread, fwrite, RTSLibError, RTSLibNotInCFS
class CFSNode(object):
# Where do we store the fabric modules spec files ?
- spec_dir = "/var/target/fabric"
+ spec_dir = "/var/lib/target/fabric"
# Where is the configfs base LIO directory ?
configfs_dir = '/sys/kernel/config/target'
# TODO: Make the ALUA path generic, not iscsi-centric
# What is the ALUA directory ?
- alua_metadata_dir = "/var/target/alua/iSCSI"
+ alua_metadata_dir = "/var/lib/target/alua/iSCSI"
# CFSNode private stuff

View File

@ -1,45 +0,0 @@
diff --git a/rtslib/utils.py b/rtslib/utils.py
index c66292c..02fef1e 100644
--- a/rtslib/utils.py
+++ b/rtslib/utils.py
@@ -24,7 +24,7 @@ import uuid
import glob
import socket
import ipaddr
-import netifaces
+import ethtool
import subprocess
from array import array
@@ -690,19 +690,19 @@ def list_eth_ips(ifnames=None):
all IPs of all ifaces excepted for lo.
'''
if ifnames is None:
- ifnames = [iface for iface in list_eth_names() if iface != 'lo']
+ devcfgs = [d for d in ethtool.get_devices() if d != 'lo']
+ else:
+ devcfgs = ethtool.get_interfaces_info(ifnames)
+
addrs = []
- for iface in list_eth_names():
- ifaddresses = netifaces.ifaddresses(iface)
- if netifaces.AF_INET in ifaddresses:
- addrs.extend(addr['addr']
- for addr in ifaddresses[netifaces.AF_INET]
- if not addr['addr'].startswith('127.'))
- if netifaces.AF_INET6 in ifaddresses:
- addrs.extend(addr['addr']
- for addr in ifaddresses[netifaces.AF_INET6]
- if not '%' in addr['addr']
- if not addr['addr'].startswith('::'))
+ for d in devcfgs:
+ if d.ipv4_address:
+ addrs.append(d.ipv4_address)
+ # For IPv6 addresses, we might have more of them on the same device,
+ # and only grab global (universe) addresses.
+ for ip6 in [a for a in d.get_ipv6_addresses() if a.scope == 'universe']:
+ addrs.append(ip6.address)
+
return sorted(set(addrs))
def is_ipv4_address(addr):

View File

@ -1,34 +1,23 @@
%global oname rtslib
%global oname rtslib-fb
Name: python-rtslib
License: AGPLv3
Group: System Environment/Libraries
Summary: API for RisingTide Systems generic SCSI target
Version: 1.99.1.git644eece
Release: 8%{?dist}
# placeholder URL and source entries
# archive created using:
# git clone git://risingtidesystems.com/rtslib.git
# cd rtslib
# git archive 644eece --prefix rtslib-%{version}/ | gzip -n > rtslib-%{version}.tar.gz
URL: http://www.risingtidesystems.com/git/
Source: %{oname}-%{version}.tar.gz
Patch1: %{name}-git-version.patch
Patch2: %{name}-use-ethtool.patch
Patch3: %{name}-update-specpath.patch
Version: 2.1.fb1
Release: 1%{?dist}
URL: https://github.com/agrover/rtslib-fb/
Source: https://github.com/agrover/%{oname}/tarball/v%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-ipaddr python-ethtool python-configobj python-devel
Requires: python-ipaddr python-ethtool python-configobj
%description
API for RisingTide Systems generic SCSI target.
API for generic Linux SCSI kernel target.
%prep
%setup -q -n %{oname}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%setup -q -n agrover-%{oname}-436f85f
%build
%{__python} setup.py build
@ -50,6 +39,14 @@ rm -rf %{buildroot}
%doc COPYING README
%changelog
* Tue Dec 6 2011 Andy Grover <agrover@redhat.com> - 2.1.fb1-1
- Change upstream URL
- New upstream release
- Remove upstreamed patches:
* python-rtslib-git-version.patch
* python-rtslib-use-ethtool.patch
* python-rtslib-update-specpath.patch
* Mon Nov 14 2011 Andy Grover <agrover@redhat.com> - 1.99.1.git644eece-8
- Change archive instructions to use gzip -n
- Fix issues raised in Fedora package review (#744349)

View File

@ -1 +1 @@
758c519cad364f290320918719db71ea rtslib-1.99.1.git644eece.tar.gz
6d3f77b1b33a81748e8db895b228603b v2.1.fb1