Discussion:
[Libstoragemgmt-devel] [PATCH] Target plugin: Fix vpd83 of volume_create() returned Volume
Gris Ge
2014-09-04 14:19:16 UTC
Permalink
* Use exist method TargetdStorage._uuid_to_vpd83() to convert uuid to VPD83.

Signed-off-by: Gris Ge <***@redhat.com>
---
plugin/targetd/targetd.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index 6d5d565..00fcf49 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
@@ -307,7 +307,8 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
vol = [v for v in self._jsonrequest("vol_list", dict(pool=pool_id))
if v['name'] == volume_name][0]

- return Volume(vol['uuid'], vol['name'], vol['uuid'], 512,
+ vpd83 = TargetdStorage._uuid_to_vpd83(vol['uuid'])
+ return Volume(vol['uuid'], vol['name'], vpd83, 512,
vol['size'] / 512,
Volume.ADMIN_STATE_ENABLED,
self.system.id,
--
1.9.3
Tony Asleson
2014-09-04 15:42:09 UTC
Permalink
Patch committed.

Thanks!
-Tony
Post by Gris Ge
* Use exist method TargetdStorage._uuid_to_vpd83() to convert uuid to VPD83.
---
plugin/targetd/targetd.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index 6d5d565..00fcf49 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
vol = [v for v in self._jsonrequest("vol_list", dict(pool=pool_id))
if v['name'] == volume_name][0]
- return Volume(vol['uuid'], vol['name'], vol['uuid'], 512,
+ vpd83 = TargetdStorage._uuid_to_vpd83(vol['uuid'])
+ return Volume(vol['uuid'], vol['name'], vpd83, 512,
vol['size'] / 512,
Volume.ADMIN_STATE_ENABLED,
self.system.id,
Loading...