Skip to content

Commit

Permalink
Python3 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
its-not-a-bug-its-a-feature authored and raags committed Oct 3, 2020
1 parent 8300816 commit 2e36ead
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion ipmi/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from ipmi import ipmitool, IPMIError
from __future__ import absolute_import

from .ipmi import ipmitool, IPMIError
4 changes: 2 additions & 2 deletions ipmi/ipmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, console, password, username='root'):

self.args = ['-I', 'lanplus', '-H', self.console, '-U', self.username]

if sys.platform == 'linux2':
if sys.platform.startswith('linux'):
self.args.extend(['-P', self.password])
self.method = self._subprocess_method

Expand Down Expand Up @@ -117,7 +117,7 @@ def _get_ipmitool_path(self, cmd='ipmitool'):
p = subprocess.Popen(["which", cmd],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return out.strip()
return out.strip().decode()


# common ipmi command shortcuts
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
setup(
name='ipmitools',
packages=['ipmi'],
version='0.3',
version='0.4',
description='Run ipmitool commands on consoles',
author='Raghu Udiyar',
author_email='[email protected]',
url='https://github.com/raags/ipmitool',
download_url='https://github.com/raags/ipmitool/tarball/0.3',
download_url='https://github.com/raags/ipmitool/tarball/0.4',
install_requires=['pexpect', 'argparse'],
entry_points={
'console_scripts': [
Expand Down

0 comments on commit 2e36ead

Please sign in to comment.