Fix up some bad imports

This commit is contained in:
Joshua Boniface 2018-09-24 01:13:05 -04:00
parent a3585da1c8
commit 1d62c48288
2 changed files with 5 additions and 6 deletions

View File

@ -21,14 +21,12 @@
############################################################################### ###############################################################################
import kazoo.client import kazoo.client
import libvirt
import sys import sys
import os import os
import signal import signal
import socket import socket
import psutil import psutil
import subprocess import subprocess
import uuid
import time import time
import configparser import configparser
import apscheduler.schedulers.background import apscheduler.schedulers.background

View File

@ -26,12 +26,12 @@ import psutil
import socket import socket
import time import time
import libvirt import libvirt
import kazoo.client
import threading import threading
import subprocess import subprocess
import daemon_lib.ansiiprint as ansiiprint import daemon_lib.ansiiprint as ansiiprint
import daemon_lib.zkhandler as zkhandler import daemon_lib.zkhandler as zkhandler
import daemon_lib.common as common
class RouterInstance(): class RouterInstance():
# Initialization function # Initialization function
@ -237,9 +237,10 @@ def fenceRouter(router_name, zk_conn, config):
# Perform an IPMI fence # Perform an IPMI fence
# #
def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password): def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password):
ipmi_command = ['/usr/bin/ipmitool', '-I', 'lanplus', '-H', ipmi_hostname, '-U', ipmi_user, '-P', ipmi_password, 'chassis', 'power', 'reset'] retcode = common.run_os_command('ipmitool -I lanplus -H {} -U {} -P {} chassis power reset'.format(
ipmi_command_output = subprocess.run(ipmi_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ipmi_hostname, ipmi_user, ipmi_password
if ipmi_command_output.returncode == 0: )
if retcode == 0:
ansiiprint.echo('Successfully rebooted dead router', '', 'o') ansiiprint.echo('Successfully rebooted dead router', '', 'o')
return True return True
else: else: