On 09/25/2013 12:22 PM, Jay Fenlason wrote:
sbp_target wants euis without leading 0x on them
Signed-Off-By: Jay Fenlason <fenlason(a)redhat.com>
Thanks, applied! -- Andy
--- fabric.py 2013-09-23 16:44:55.000000000 -0400
+++ fabric.py.new 2013-09-25 13:36:36.000000000 -0400
@@ -336,10 +336,10 @@ class SBPFabricModule(_BaseFabricModule)
self.kernel_module = "sbp_target"
def to_fabric_wwn(self, wwn):
- return "0x" + wwn[4:]
+ return wwn[4:]
def from_fabric_wwn(self, wwn):
- return "eui." + wwn[2:]
+ return "eui." + wwn
# return 1st local guid (is unique) so our share is named uniquely
@property
@@ -347,7 +347,10 @@ class SBPFabricModule(_BaseFabricModule)
for fname in glob("/sys/bus/firewire/devices/fw*/is_local"):
if bool(int(fread(fname))):
guid_path = os.path.dirname(fname) + "/guid"
- yield self.from_fabric_wwn(fread(guid_path))
+ tmp = fread(guid_path)
+ if tmp[0:2] == '0x':
+ tmp = tmp[2:]
+ yield self.from_fabric_wwn(tmp)
break