Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Michio Honda committed Nov 22, 2024
1 parent 9dba88f commit 708da7e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,6 @@ def get_db(self, node=None):
res = self.db.all()
return None if len(res) == 0 else res

def get_ipmi_cred(self, node):
r = self.db.get(Query().node == node)
return r['ipmipass'].split(',')

def do_ipmi(self, node, command, noowner):
if not noowner and not self.owner_or_root(node, needuser=False):
self.pr_msg('Invalid user')
Expand All @@ -762,7 +758,7 @@ def do_ipmi(self, node, command, noowner):
if not self.is_reachable(addr):
self.pr_msg('{}: IPMI address unreachable'.format(node))
return
userpass = self.get_ipmi_cred(node)
userpass = self.db.get(Query().node == node)['ipmipass'].split(',')
cmd = 'ipmitool -I lanplus -C 3 -H {} -U {} -P {} '.format(
addr, userpass[0], userpass[1])
console = command == 'console'
Expand Down

0 comments on commit 708da7e

Please sign in to comment.