From 09b6a7cd8b9f9a4351188982444856cfc77309fa Mon Sep 17 00:00:00 2001 From: Cian Brennan Date: Wed, 29 Apr 2015 12:52:15 +0100 Subject: [PATCH] Fixes for pep8 tests Pep8 tests were failing due to an error in requirements.txt pep8 was specified as allowing from 1.5.7, with no minimum version. Flake8 however fails with versions >1.6. Added this requirement, and also fixed errors from pep8 tests Change-Id: I24cb0ff34d6a28a6932a8df1206add287aca1e29 --- satori/common/popen.py | 2 +- satori/discovery.py | 14 +++++++------- test-requirements.txt | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/satori/common/popen.py b/satori/common/popen.py index f637bad..8104fe8 100644 --- a/satori/common/popen.py +++ b/satori/common/popen.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -""" Popen wrapper to allow custom patching of subprocess.Popen.""" +"""Popen wrapper to allow custom patching of subprocess.Popen.""" import subprocess diff --git a/satori/discovery.py b/satori/discovery.py index 9c98d99..3a0adc8 100644 --- a/satori/discovery.py +++ b/satori/discovery.py @@ -27,7 +27,7 @@ import sys import traceback import ipaddress -from novaclient.v1_1 import client +import novaclient.v1_1 from pythonwhois import shared import six @@ -128,12 +128,12 @@ def discover_host(address, config, interactive=False): def find_nova_host(address, config): """See if a nova instance has the supplied address.""" - nova = client.Client(config['username'], - config['password'], - config['tenant_id'], - config['authurl'], - region_name=config['region'], - service_type="compute") + nova = novaclient.v1_1.client.Client(config['username'], + config['password'], + config['tenant_id'], + config['authurl'], + region_name=config['region'], + service_type="compute") for server in nova.servers.list(): for network_addresses in six.itervalues(server.addresses): for ip_address in network_addresses: diff --git a/test-requirements.txt b/test-requirements.txt index 3ab29ab..9e1a4b6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,7 @@ flake8_docstrings>=0.2.0 # patched for py33 fixtures>=0.3.14 freezegun mock>=1.0 -pep8>=1.5.7 +pep8>=1.5.7,<1.6 pep257>=0.3.2 # patched for py33 sphinx>=1.2.2 testrepository>=0.0.17