diff --git a/ipmi/__init__.py b/ipmi/__init__.py index e6ee538..8e170ae 100644 --- a/ipmi/__init__.py +++ b/ipmi/__init__.py @@ -1 +1,3 @@ -from ipmi import ipmitool, IPMIError +from __future__ import absolute_import + +from .ipmi import ipmitool, IPMIError diff --git a/ipmi/ipmi.py b/ipmi/ipmi.py index d02867e..92c3b28 100644 --- a/ipmi/ipmi.py +++ b/ipmi/ipmi.py @@ -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 @@ -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 diff --git a/setup.py b/setup.py index 75b1fe7..a74c60c 100644 --- a/setup.py +++ b/setup.py @@ -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='raghusiddarth@gmail.com', 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': [