emc-openstack / storops

Python storage management library for VNX and Unity.
Apache License 2.0
54 stars 29 forks source link

Incorrect response from nfs_share create() call #333

Closed v-soni11 closed 3 years ago

v-soni11 commented 4 years ago

Issue: Incorrect response from nfs_share create() call

Description: When we have two filesystems with same name on different NAS, and then we try to create NFS on both the filesystems with same name, nfs_share.py create() function returns wrong/different nfs share object.

Steps to reproduce the issue:

  1. create filesystem 'abc' on nasserver 'lglad071'
  2. create filesystem 'abc' on nasserver 'lglad069'
  3. create NFS 'test_nfs' from filesystem 'abc' which is on nasserver 'lglad071'
  4. create NFS 'test_nfs' from filesystem 'abc' which is on nasserver 'lglad069' using below code snippet:
from storops.unity.resource import nfs_share
from storops import UnitySystem

# Create connection object
>>> conn = UnitySystem('xx.xx.xx.xx', 'username', 'password', verify=False)

# Get NAS object
>>> nas_obj = conn.get_nas_server(name="lglad069")

# Get Filesystem object
>>> fs = conn.get_filesystem(name="abc", nas_server=nas_obj)

# Create NFS Share
>>> nfs = nfs_share.UnityNfsShare.create(conn._cli, "test_nfs", fs)

# Validate created NFS Share 
>>> nfs.filesystem.nas_server.name # should return 'lglad069'
'lglad071'

nfs_share.create() call returns wrong/different nfs_share obj whose name is same as we gave in create(name=''test_nfs) parameter

yong-huang commented 4 years ago

Root caused, will fix it.

yong-huang commented 4 years ago

Fixed in https://github.com/emc-openstack/storops/pull/335

v-soni11 commented 3 years ago

Verified and its working fine now Thanks