initial import (#744349)
This commit is contained in:
		
							parent
							
								
									9ce32c2310
								
							
						
					
					
						commit
						cdb3c35b73
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -0,0 +1 @@ | ||||
| /rtslib-1.99.1.git644eece.tar.gz | ||||
							
								
								
									
										13
									
								
								python-rtslib-git-version.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								python-rtslib-git-version.patch
									
									
									
									
									
										Normal file
									
								
							| @ -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@risingtidesystems.com>" | ||||
|  __url__ = "http://www.risingtidesystems.com" | ||||
|  __description__ = "API for RisingTide Systems generic SCSI target." | ||||
							
								
								
									
										27
									
								
								python-rtslib-update-specpath.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								python-rtslib-update-specpath.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| 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 | ||||
|   | ||||
							
								
								
									
										45
									
								
								python-rtslib-use-ethtool.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								python-rtslib-use-ethtool.patch
									
									
									
									
									
										Normal file
									
								
							| @ -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): | ||||
							
								
								
									
										71
									
								
								python-rtslib.spec
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								python-rtslib.spec
									
									
									
									
									
										Normal file
									
								
							| @ -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@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@redhat.com> - 1.99.1.git644eece-7 | ||||
| - Remove patch | ||||
|   * python-rtslib-del-unused-specs.patch | ||||
| 
 | ||||
| * Wed Aug 17 2011 Andy Grover <agrover@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@redhat.com> - 1.99-1 | ||||
| - Initial packaging | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user