Permalink
Browse files

pep8 fixes

  • Loading branch information...
1 parent f133dc2 commit 64c9d841cd982c21f1095a280a78ec0c59235953 @labisso labisso committed Mar 19, 2013
@@ -4,11 +4,15 @@
from epu.states import InstanceState, InstanceHealthState
from epu.decisionengine.impls.simplest import CONF_PRESERVE_N
from epu.epumanagement import EPUManagement
-from epu.epumanagement.conf import *
+from epu.epumanagement.conf import EPUM_INITIALCONF_EXTERNAL_DECIDE,\
+ EPUM_DEFAULT_SERVICE_NAME, EPUM_CONF_ENGINE_CLASS, EPUM_CONF_HEALTH_MONITOR,\
+ EPUM_CONF_GENERAL, EPUM_CONF_HEALTH, EPUM_CONF_ENGINE, EPUM_CONF_HEALTH_BOOT,\
+ EPUM_CONF_HEALTH_MISSING, EPUM_CONF_HEALTH_ZOMBIE, EPUM_CONF_HEALTH_REALLY_MISSING
from epu.epumanagement.store import LocalDomainStore, LocalEPUMStore
from epu.epumanagement.core import CoreInstance
from epu.epumanagement.health import TESTCONF_HEALTH_INIT_TIME
-from epu.epumanagement.test.mocks import MockOUAgentClient, MockProvisionerClient, MockSubscriberNotifier, MockDTRSClient
+from epu.epumanagement.test.mocks import MockOUAgentClient, MockProvisionerClient,\
+ MockSubscriberNotifier, MockDTRSClient
from epu.epumanagement.test.test_epumanagement import MOCK_PKG
@@ -50,7 +54,8 @@ def setUp(self):
self.epum_store = LocalEPUMStore(EPUM_DEFAULT_SERVICE_NAME)
self.epum_store.initialize()
self.epum = EPUManagement(
- initial_conf, self.notifier, self.provisioner_client, self.ou_client, self.dtrs_client, store=self.epum_store)
+ initial_conf, self.notifier, self.provisioner_client,
+ self.ou_client, self.dtrs_client, store=self.epum_store)
self.provisioner_client._set_epum(self.epum)
self.ou_client._set_epum(self.epum)
@@ -2,8 +2,11 @@
import logging
from epu.epumanagement import EPUManagement
-from epu.epumanagement.test.mocks import MockSubscriberNotifier, MockProvisionerClient, MockOUAgentClient, MockDTRSClient
-from epu.epumanagement.conf import *
+from epu.epumanagement.test.mocks import MockSubscriberNotifier,\
+ MockProvisionerClient, MockOUAgentClient, MockDTRSClient
+from epu.epumanagement.conf import EPUM_INITIALCONF_EXTERNAL_DECIDE,\
+ EPUM_DEFAULT_SERVICE_NAME, EPUM_CONF_ENGINE_CLASS, EPUM_CONF_HEALTH_MONITOR,\
+ EPUM_CONF_GENERAL, EPUM_CONF_HEALTH, EPUM_CONF_ENGINE
from epu.epumanagement.store import LocalEPUMStore
from epu.states import InstanceState
from epu.decisionengine.impls.simplest import CONF_PRESERVE_N
@@ -24,7 +27,8 @@ def setUp(self):
self.epum_store = LocalEPUMStore(EPUM_DEFAULT_SERVICE_NAME)
self.epum_store.initialize()
self.epum = EPUManagement(
- initial_conf, self.notifier, self.provisioner_client, self.ou_client, self.dtrs_client, store=self.epum_store)
+ initial_conf, self.notifier, self.provisioner_client, self.ou_client,
+ self.dtrs_client, store=self.epum_store)
# For instance-state changes "from the provisioner"
self.provisioner_client._set_epum(self.epum)
@@ -241,7 +245,6 @@ def _fail_setup(self):
self.epum.initialize()
self.epum._run_decisions()
self.assertEqual(self.provisioner_client.provision_count, 0)
- constraints = {CONF_IAAS_SITE: "00_iaas_site", CONF_IAAS_ALLOCATION: "00_iaas_alloc"}
definition_id = "definition1"
definition = self._get_simplest_domain_definition()
self.epum.msg_add_domain_definition(definition_id, definition)
@@ -162,8 +162,7 @@ def _assert_n_processes(self, n, timeout=None, only_pd=None):
return
else:
for proc in procs:
- msg = "expected %s to be terminated but is %s" % (
- proc['upid'], proc['state'])
+ msg = "expected %s to be terminated but is %s" % (proc['upid'], proc['state'])
assert proc['state'] in ('600-TERMINATING', '700-TERMINATED', '800-EXITED'), msg
return
@@ -297,7 +297,8 @@ def __init__(self, document, element):
nameElem = element.find('name')
if nameElem is not None and nameElem.text:
self.name = nameElem.text.strip()
- else: self.name = ''
+ else:
+ self.name = ''
# TODO validate NICs/doctor ctx
@@ -32,11 +32,11 @@
dt_name = "sleeper"
sleeper_dt = {
'mappings': {
- 'site1': {
- 'iaas_image': 'ami-fake',
- 'iaas_allocation': 't1.micro',
+ 'site1': {
+ 'iaas_image': 'ami-fake',
+ 'iaas_allocation': 't1.micro',
+ }
}
- }
}
@@ -84,8 +84,7 @@ def test_example(self):
while True:
instances = self.provisioner_client.describe_nodes()
- if (instances[0]['state'] == '200-REQUESTED' or
- instances[0]['state'] == '400-PENDING'):
+ if instances[0]['state'] in ('200-REQUESTED', '400-PENDING'):
continue
elif instances[0]['state'] == '600-RUNNING':
break
@@ -9,9 +9,9 @@
"description": "Nimbus cloud on the Hotel FutureGrid site",
"driver_class": "libcloud.compute.drivers.ec2.NimbusNodeDriver",
"driver_kwargs": {
- "host": "svc.uc.futuregrid.org",
- "port": 8444
- }
+ "host": "svc.uc.futuregrid.org",
+ "port": 8444
+ }
}
site2 = {
@@ -153,7 +153,6 @@ def assure_subscribers(self, node_id, subscribers):
def wait_for_state(self, state, nodes=None,
before=None, before_kwargs=None, timeout=30):
- import time
if before_kwargs is None:
before_kwargs = {}
@@ -53,7 +53,7 @@ def get_metric_statistics(self, period, start_time, end_time, metric_name,
if not dimensions.get('InstanceId'):
raise ProgrammingError("You must supply an instance id")
if (not isinstance(dimensions.get('InstanceId'), basestring) and
- len(dimensions.get('InstanceId')) > 1):
+ len(dimensions.get('InstanceId')) > 1):
raise ProgrammingError("You may only supply one instance id")
if not isinstance(statistics, basestring) and len(statistics) > 1:
@@ -65,7 +65,7 @@ def test_get_metric_statistics(self):
def test_get_metric_statistics_app_attributes(self):
- test_host = os.environ.get("TRAFFIC_SENTINEL_HOST", "fake.ts.host.tld")
+ # test_host = os.environ.get("TRAFFIC_SENTINEL_HOST", "fake.ts.host.tld")
test_process = os.environ.get("TRAFFIC_SENTINEL_PROCESS", "fake.process")
queue_length = 1
ml = 1

0 comments on commit 64c9d84

Please sign in to comment.