Flake8 fixes for OpenCafe

* Removed unused imports
* Fixed invalid class name in linux_instance_client
* Fixed various pep8 issues

Change-Id: If269b7590f331a0d5cb11d4813bdf9b03dbbb417
This commit is contained in:
Daryl Walleck 2013-07-10 14:29:44 -05:00
parent eb42ed58a7
commit 75b3b7a341
8 changed files with 3 additions and 15 deletions

View File

@ -19,7 +19,6 @@ limitations under the License.
'''
import os
from datetime import datetime
from unittest2.result import TestResult
class TestRunMetrics(object):

View File

@ -20,7 +20,6 @@ limitations under the License.
@see: http://docs.python.org/library/unittest.html#unittest.TestCase
'''
import unittest2 as unittest
from datetime import datetime
from cafe.engine.config import EngineConfig
from cafe.common.reporting import cclogging

View File

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
import unittest2 as unittest
import xml.etree.ElementTree as ET

View File

@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
import decorator
from cafe.common.reporting import cclogging

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
class InstanceClientConstants:
LAST_REBOOT_TIME_FORMAT = '%Y-%m-%d %H:%M'
LAST_REBOOT_TIME_FORMAT_GENTOO = '%b %d %H:%M %Y'
LINUX_OS_FAMILY = 'linux'

View File

@ -15,10 +15,6 @@ limitations under the License.
"""
from cafe.common.reporting import cclogging
from cafe.engine.clients.remote_instance.linux.linux_instance_client \
import LinuxClient
from cafe.engine.clients.remote_instance.windows.windows_instance_client \
import WindowsClient
class InstanceClientFactory(object):

View File

@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
from paramiko import PKey
import time
import re
@ -38,7 +37,6 @@ class LinuxClient(BasePersistentLinuxClient):
self.client_log = cclogging.getLogger(
cclogging.get_object_namespace(self.__class__))
ssh_timeout = config.connection_timeout
if ip_address is None:
raise ServerUnreachable("None")
@ -107,8 +105,8 @@ class LinuxClient(BasePersistentLinuxClient):
'''
@timeout: max timeout for the machine to reboot
'''
ssh_connector = SSHConnector(self.ip_address, self.username,
self.password)
ssh_connector = SSHBaseClient(self.ip_address, self.username,
self.password)
response, prompt = ssh_connector.exec_shell_command("sudo reboot")
response, prompt = ssh_connector.exec_shell_command(self.password)
self.client_log.info("Reboot response for %s: %s" % (self.ip_address,

View File

@ -22,7 +22,6 @@ import platform
# These imports are only possible on Linux/OSX
if platform.system().lower() != 'windows':
import pwd
import grp
try:
from setuptools import setup, find_packages