-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for unity host attach/detach unity lun #2
Conversation
* create/modify lun * list/create/modify host initiator
Hi @crook , the coverage dropped a little. It would be appreciated if you could remove the unused code or cover them with unit test. The detail data can be retrieved here: |
return False | ||
|
||
has = False | ||
for host_lun in self.host_luns: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are duplicated.
I would suggest to create a property like this:
@properties
@instance_cache
def lun_ids(self):
ret = []
if self.host_luns:
for host_lun in self.host_luns:
if host_lun.lun:
ret.append(host_lun.lun.id)
return ret
def has_hlu(self, lun):
return lun.id in self.lun_ids
The @instance_cache
here works as an instance level memoize.
The code suggested here is a demonstration of the thoughts. Please try to converge the duplicated for
loops.
Hi @crook , |
in host.py. Retry is supported now
* Add pool.create_lun and system.create_host * Add more test for coverage
* add more test coverage
Add support for unity host attach/detach unity lun