Skip to content
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

storagepool_size division by zero with empty PDs/pools #2

Open
infernix opened this issue Dec 15, 2016 · 4 comments
Open

storagepool_size division by zero with empty PDs/pools #2

infernix opened this issue Dec 15, 2016 · 4 comments

Comments

@infernix
Copy link

For empty PDs and/or storage pools (no SDSes), this happens when: stats = cluster.storagepool_size(pd, pool)

  File "/usr/lib/python2.7/site-packages/siolib/scaleio.py", line 767, in storagepool_size
    'capacityLimitInKb') / sds_count
ZeroDivisionError: integer division or modulo by zero

Obviously not a common scenario but some sanity checks should be put in place; iteration over just newly created empty PDs and/or storage pools may trip over this and break execution.

@ftersin
Copy link
Contributor

ftersin commented Dec 16, 2016

Thanks. We'll deal with that soon.

@infernix
Copy link
Author

@ftersin before I start to send in patches, is there a reason why https://github.com/gmmephisto/pyscaleio was not used? Perhaps licensing?

@ftersin
Copy link
Contributor

ftersin commented Dec 20, 2016

Well, there are several reasons. Each one of them is probably not so important, but totally..

Our team started this work on Feb 16 (but that repo is created on Mar 16), and we started not with a clean state. That library does not use separate exceptions for certain ScaleIO errors, which lead us to check error codes directly, which is a few undesirable (once ScaleIO changed some error codes; and anyway this would bring more deep relations than we wanted). Also our own library gives us more flexibility, speed of changes, and confidence of future maintaining.

Licensing might be a problem, but as i see on openstack/requirements, some required packages uses the same LGPLv3.

ps. Although if we'd start now, i preferred that library.

@ftersin
Copy link
Contributor

ftersin commented Dec 23, 2016

Fixed in branches of https://github.com/codedellemc/python-scaleioclient (except master branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants