Skip to content

Commit

Permalink
Finished Release v0.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnon Yaari committed Dec 18, 2016
2 parents b8d4ffc + 98b16cb commit ded453b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 27 deletions.
26 changes: 1 addition & 25 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pre_uninstall_script_name = None

[isolated-python]
recipe = infi.recipe.python
version = v2.7.6.21
version = v2.7.8.5

[setup.py]
recipe = infi.recipe.template.version
Expand All @@ -36,42 +36,18 @@ output = setup.py
[__version__.py]
recipe = infi.recipe.template.version
output = ${project:version_file}
input = inline:
__version__ = "${infi.recipe.template.version:version}"
__git_commiter_name__ = "${infi.recipe.template.version:author}"
__git_commiter_email__ = "${infi.recipe.template.version:author_email}"
__git_branch__ = ${infi.recipe.template.version:git_local_branch}
__git_remote_tracking_branch__ = ${infi.recipe.template.version:git_remote_tracking_branch}
__git_remote_url__ = ${infi.recipe.template.version:git_remote_url}
__git_head_hash__ = ${infi.recipe.template.version:head_hash}
__git_head_subject__ = ${infi.recipe.template.version:head_subject}
__git_head_message__ = ${infi.recipe.template.version:head_message}
__git_dirty_diff__ = ${infi.recipe.template.version:dirty_diff}

[development-scripts]
dependent-scripts = true
recipe = infi.recipe.console_scripts
eggs = ${project:name}
ipython
nose
mock
coverage
pylint
infi.unittest
infi.traceback
interpreter = python

[eclipse]
recipe = rbco.recipe.pyeclipse
project-name = ${project:name}
project-directory = ${buildout:directory}
python-version = 2.7
source-resources = ${buildout:directory}/src

[pydev]
recipe = pb.recipes.pydev
eggs = ${development-scripts:eggs}

[pack]
recipe = infi.recipe.application_packager

Expand Down
7 changes: 7 additions & 0 deletions src/infi/sgutils/ioctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ def scsi_ioctl_get_idlun(device_path):
result = ioctl(device_path, opcodes.SCSI_IOCTL_GET_IDLUN, buffer)
struct = struct_cls.create_from_string(buffer)
return struct

def scsi_ioctl_get_bus_number(device_path):
""":returns: a :class:`.SG_GET_SCSI_ID` object"""
from ctypes import c_ulong
buffer = c_ulong()
result = ioctl(device_path, opcodes.SCSI_IOCTL_GET_BUS_NUMBER, buffer)
return buffer.value
1 change: 1 addition & 0 deletions src/infi/sgutils/ioctl/opcodes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

SG_GET_SCSI_ID = 0x2276
SCSI_IOCTL_GET_IDLUN = 0x5382
SCSI_IOCTL_GET_BUS_NUMBER = 0x5386

6 changes: 4 additions & 2 deletions src/infi/sgutils/sg_map/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def get_hctl_for_sg_device(device_path):
return HCTL(struct.host_no, struct.channel, struct.scsi_id, struct.lun)

def get_hctl_for_sd_device(device_path):
from ..ioctl import scsi_ioctl_get_idlun as _ioctl
struct = _ioctl(device_path)
from ..ioctl import scsi_ioctl_get_idlun, scsi_ioctl_get_bus_number
struct = scsi_ioctl_get_idlun(device_path)
# http://tldp.org/HOWTO/SCSI-Generic-HOWTO/scsi_g_idlun.html
# "four_in_one" is made up as follows:
# (scsi_device_id | (lun << 8) | (channel << 16) | (host_no << 24))
Expand All @@ -16,6 +16,8 @@ def get_hctl_for_sd_device(device_path):
target = (struct.four_in_one) & 0xFF
lun = (struct.four_in_one >> 8) & 0xFF
result = HCTL(host, channel, target, lun)
# STORAGEMODEL-376: re-read host number with a ioctl that doesn't limit the value to 255
host = scsi_ioctl_get_bus_number(device_path)
return HCTL(host, channel, target, lun)

def get_sg_to_hctl_mappings():
Expand Down

0 comments on commit ded453b

Please sign in to comment.