[Starlingx-discuss] check_osds_down_up check range

Liu, Changcheng changcheng.liu at intel.com
Wed Jan 23 05:37:11 UTC 2019


Hi John,
Could you help check whether there's something wrong with below code?
   File: cgcs-root/stx/stx-metal/inventory/inventory/inventory/common/ceph.py
   96     def check_osds_down_up(self, hostname, upgrade):
   97         # check if osds from a storage are down/up
   98         response, body = self._ceph_api.osd_tree(body='json')
   99         osd_tree = body['output']['nodes']
  100         size = len(osd_tree)
  101         for i in range(1, size):
Is there something special reason to not range from 0? i.e. range(0, size)

B.R.
Changcheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.starlingx.io/pipermail/starlingx-discuss/attachments/20190123/3fb97f57/attachment.html>


More information about the Starlingx-discuss mailing list