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

IPMITool: futurize it #561

Merged
merged 1 commit into from
Oct 4, 2017
Merged

IPMITool: futurize it #561

merged 1 commit into from
Oct 4, 2017

Conversation

hppritcha
Copy link
Member

the IPMITool wasn't working with python3. Change
so that, provided future is installed with python,
it can work both with python 2 and 3. We already
require future for other parts of pyclient.

Signed-off-by: Howard Pritchard [email protected]

@noahv
Copy link
Contributor

noahv commented Sep 15, 2017

Hi Howard, this has issues for python 2.7. I will look into this further.

ERROR:yapsy:Unable to import plugin: /opt/mtt/pylib/Tools/CNC/IPMITool
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/Yapsy-1.11.223-py2.7.egg/yapsy/PluginManager.py", line 488, in loadPlugins
    candidate_module = imp.load_module(plugin_module_name,plugin_file,candidate_filepath+".py",("py","r",imp.PY_SOURCE))
  File "/opt/mtt/pylib/Tools/CNC/IPMITool.py", line 13, in <module>
    from queue import Queue, heapq, deque
ImportError: cannot import name heapq
[<yapsy.PluginInfo.PluginInfo object at 0x7f92ed9125d0>]

@hppritcha
Copy link
Member Author

I'll investigate too.

@hppritcha
Copy link
Member Author

hppritcha commented Sep 20, 2017

This works for my with my python 2.7 setup. You have future installed right?
I'm working on a rhel7.2 system with 2.7.5 (which came with the distro).

@ribab
Copy link
Contributor

ribab commented Sep 20, 2017

I noticed on our machines this works:

from Queue import heapq, deque
import Queue

But this does not work:

from queue import Queue, heapq, deque

@ribab
Copy link
Contributor

ribab commented Sep 20, 2017

Future is installed on our machines.

Python version is Python 2.7.9
System type is sles12sp1

@hppritcha
Copy link
Member Author

@ribab now try, doing things a different way. Works for me with my python. Also futurized Environ.py.

@hppritcha
Copy link
Member Author

futurized another thing. unicode type doesn't exist explicitly with python3.

@hppritcha hppritcha force-pushed the topic/futurize_ipmitool branch 2 times, most recently from 1b1841f to a6d9c4b Compare September 21, 2017 18:45
Okay try again with IMPITool to futurize it to work
both with Python 2 and later

Also, futurize Environ.py so python 3 doesn't panic
with print statements.

Python 3 doesn't have a special unicode type.
Conditionally check for unicode type for value only when
using Python 2.

Signed-off-by: Howard Pritchard <[email protected]>
@ribab
Copy link
Contributor

ribab commented Sep 29, 2017

I don't have any tests that use IPMITool I can use to test this, however everything compiles with no syntax errors now. I will approve this request.

@ribab
Copy link
Contributor

ribab commented Sep 29, 2017

I'm not an reviewer, so @noahv has to approve.

@hppritcha hppritcha merged commit 2c44744 into master Oct 4, 2017
@hppritcha hppritcha deleted the topic/futurize_ipmitool branch November 26, 2017 17:50
emallove pushed a commit to emallove/mtt that referenced this pull request Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants