Hi Gris,
Please add a unit test for this, eg. creating then deleting a volume and
then calling volume_raid_info on the non-existing volume and for good
path as we don't appear to have unit tests for volume_raid_info.
Thanks,
Tony
On 08/05/2015 08:23 AM, Gris Ge wrote:
* Run the volume/LUN existence check before checking RAID
information.
Signed-off-by: Gris Ge <fge(a)redhat.com>
---
plugin/ontap/ontap.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index 107f295..4ffad56 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -1306,6 +1306,9 @@ def _raid_type_of_na_aggr(na_aggr):
@handle_ontap_errors
def volume_raid_info(self, volume, flags=0):
+ # Check existance of LUN
+ self.f.luns_get_specific(None, na_lun_name=volume.id);
+
na_vol_name = Ontap._get_volume_from_path(volume.pool_id)
na_vol = self.f.volumes(volume_name=na_vol_name)
if len(na_vol) == 0: