[python-rtslib] initial import (#744349)

Andy Grover grover at fedoraproject.org
Wed Nov 16 20:15:48 UTC 2011


commit cdb3c35b73e20823554feb5e2a070c190f9e1ad2
Author: Andy Grover <agrover at redhat.com>
Date:   Wed Nov 16 12:15:36 2011 -0800

    initial import (#744349)

 .gitignore                          |    1 +
 python-rtslib-git-version.patch     |   13 ++++++
 python-rtslib-update-specpath.patch |   27 +++++++++++++
 python-rtslib-use-ethtool.patch     |   45 ++++++++++++++++++++++
 python-rtslib.spec                  |   71 +++++++++++++++++++++++++++++++++++
 sources                             |    1 +
 6 files changed, 158 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..3dd2135 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/rtslib-1.99.1.git644eece.tar.gz
diff --git a/python-rtslib-git-version.patch b/python-rtslib-git-version.patch
new file mode 100644
index 0000000..6b18c1d
--- /dev/null
+++ b/python-rtslib-git-version.patch
@@ -0,0 +1,13 @@
+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 at risingtidesystems.com>"
+ __url__ = "http://www.risingtidesystems.com"
+ __description__ = "API for RisingTide Systems generic SCSI target."
diff --git a/python-rtslib-update-specpath.patch b/python-rtslib-update-specpath.patch
new file mode 100644
index 0000000..9aab244
--- /dev/null
+++ b/python-rtslib-update-specpath.patch
@@ -0,0 +1,27 @@
+commit 25f651279f95a29682bee72b56a6730a91d17f27
+Author: Andy Grover <agrover at redhat.com>
+Date:   Wed Aug 17 16:08:15 2011 -0700
+
+    change spec_dir to /var/lib/target
+    
+    Signed-off-by: Andy Grover <agrover at 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
+ 
diff --git a/python-rtslib-use-ethtool.patch b/python-rtslib-use-ethtool.patch
new file mode 100644
index 0000000..88b6f05
--- /dev/null
+++ b/python-rtslib-use-ethtool.patch
@@ -0,0 +1,45 @@
+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):
diff --git a/python-rtslib.spec b/python-rtslib.spec
new file mode 100644
index 0000000..e36855f
--- /dev/null
+++ b/python-rtslib.spec
@@ -0,0 +1,71 @@
+%global oname rtslib
+
+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
+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.
+
+%prep
+%setup -q -n %{oname}-%{version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf %{buildroot}
+%{__python} setup.py install --skip-build --root %{buildroot}
+mkdir -p %{buildroot}/var/lib/target/fabric
+cp specs/* %{buildroot}/var/lib/target/fabric
+
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root,-)
+%{python_sitelib}
+/var/lib/target
+%doc COPYING README
+
+%changelog
+* Mon Nov 14 2011 Andy Grover <agrover at redhat.com> - 1.99.1.git644eece-8
+- Change archive instructions to use gzip -n
+- Fix issues raised in Fedora package review (#744349)
+
+* Thu Oct 6 2011 Andy Grover <agrover at redhat.com> - 1.99.1.git644eece-7
+- Remove patch
+  * python-rtslib-del-unused-specs.patch
+
+* Wed Aug 17 2011 Andy Grover <agrover at redhat.com> - 1.99-6
+- Update based on review comments
+  - Fully document steps to build archive
+  - Remove commented-out extraneous text
+  - Remove a repeat in Requires line
+  - Update git-version.patch to have proper sha1
+  - Change location of fabric spec files to /var/lib/target
+- Remove unused specs
+
+* Tue May 10 2011 Andy Grover <agrover at redhat.com> - 1.99-1
+- Initial packaging
diff --git a/sources b/sources
index e69de29..9eed6c7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+758c519cad364f290320918719db71ea  rtslib-1.99.1.git644eece.tar.gz


More information about the scm-commits mailing list