Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

python 2.7 import urllib.parse ImportError: No module named parse #26

Closed
tdelov opened this issue Aug 26, 2020 · 3 comments
Closed

python 2.7 import urllib.parse ImportError: No module named parse #26

tdelov opened this issue Aug 26, 2020 · 3 comments

Comments

@tdelov
Copy link

tdelov commented Aug 26, 2020

root@bbcd54098726:# python --version
Python 2.7.16
root@bbcd54098726:
# python test2.py
Traceback (most recent call last):
File "test2.py", line 5, in
import check_mk_web_api
File "/usr/local/lib/python2.7/site-packages/check_mk_web_api/init.py", line 6, in
import urllib.parse
ImportError: No module named parse

My script.

import check_mk_web_api
import os, ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)):
    ssl._create_default_https_context = ssl._create_unverified_context


myhostname = "myhost.domain.edu"
api = check_mk_web_api.WebApi('https://checkmk.domain.edu/manage/check_mk/webapi.py', username='automation', secret='123456')

myresult = api.get_host( myhostname , effective_attributes=True)
print ( myresult )

@perlduck
Copy link
Contributor

I noticed that as well and added pull request #23 which fixes this. It is not yet included in the master branch.

@brennerm
Copy link
Owner

Fixed with #23. Will be part of the next release.

@brennerm
Copy link
Owner

brennerm commented Nov 2, 2020

Has been fixed with release 1.7.1.

@brennerm brennerm closed this as completed Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants