Skip to content

Commit

Permalink
update ipmihelper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindmani-1 committed Feb 2, 2021
1 parent 4e1f3a1 commit 6dab168
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def get_ipmitool_raw_output(args):
command = "ipmitool raw {}".format(args)
try:
proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE,
universal_newlines=True,stderr=subprocess.STDOUT)
universal_newlines=True, stderr=subprocess.STDOUT)
stdout = proc.communicate()[0]
proc.wait()
if not proc.returncode:
result = stdout.rstrip('\n')
except:
except EnvironmentError:
pass

for i in result.split():
Expand Down Expand Up @@ -175,12 +175,12 @@ def _get_ipmitool_fru_print(self):
command = "ipmitool fru print {}".format(self.id)
try:
proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE,
universal_newlines=True,stderr=subprocess.STDOUT)
universal_newlines=True, stderr=subprocess.STDOUT)
stdout = proc.communicate()[0]
proc.wait()
if not proc.returncode:
result = stdout.decode('utf-8').rstrip('\n')
except:
result = stdout.rstrip('\n')
except EnvironmentError:
pass

return result
Expand Down Expand Up @@ -248,12 +248,12 @@ def get_fru_data(self, offset, count=1):
offset_MSB, count)
try:
proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE,
universal_newlines=True,stderr=subprocess.STDOUT)
universal_newlines=True, stderr=subprocess.STDOUT)
stdout = proc.communicate()[0]
proc.wait()
if not proc.returncode:
result = stdout.decode('utf-8').rstrip('\n')
except:
result = stdout.rstrip('\n')
except EnvironmentError:
is_valid = False

if (not result) or (not is_valid):
Expand Down

0 comments on commit 6dab168

Please sign in to comment.