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

IndexError: string index out of range #27

Open
nitudoudou opened this issue Feb 23, 2022 · 3 comments
Open

IndexError: string index out of range #27

nitudoudou opened this issue Feb 23, 2022 · 3 comments

Comments

@nitudoudou
Copy link

nitudoudou commented Feb 23, 2022

Error Message:

File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkbase.py", line 489, in get_entityjson
    if not self.my_get_entityjson():
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkbase.py", line 447, in my_get_entityjson
    return self.get_partial_entityjson(*plist)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkbase.py", line 461, in get_partial_entityjson
    enjson = self.cfactory.enumerate_list(self.entityjson, *comps)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkconnfactory.py", line 191, in enumerate_list
    comp_details = self.enumerate_view(comp)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkconnfactory.py", line 126, in enumerate_view
    retval = connection.enumerate_view(index, True)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkproto.py", line 411, in enumerate_view
    return self._enumerate_view(index, self.views, bTrue)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkproto.py", line 471, in _enumerate_view
    self._apply_spec(i, en)
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkproto.py", line 344, in _apply_spec
    rjson[i] = str(':'.join([s[j] + s[j + 1] for j in range(2, 12, 2)]))
  File "/usr/local/python3/lib/python3.7/site-packages/omsdk/sdkproto.py", line 344, in <listcomp>
    rjson[i] = str(':'.join([s[j] + s[j + 1] for j in range(2, 12, 2)]))

Although I worked it out that way:
Edit sdkproto.py
image
I still hope the official can adjust it.
THX.

@oikencrs
Copy link

Thanks for your workaround, work like a charm !

@anupamaloke
Copy link

@nitudoudou, Thank you for sharing this workaround. Any chance you could submit a PR for this as well?

@anupamaloke
Copy link

@nitudoudou, just curious on omsdk usage where you are receiving this error. Are you using omsdk with Nagios or any other solution?

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

3 participants