Isolate eventlet code into environment.

The environment module will be configured once, during code initialization.
Subsequently all other possibly-evented modules will retrieve from
environment and transparently obtain either the eventlet or standard
library modules.

If eventlet, httplib, subprocess or other environment dependant module
is referenced outside of the environment module it should be considered
a bug.

The changes to tests are required to ensure that test is imported first
to setup the environment. Hopefully these can all be replaced with an
__init__.py in a post-nose keystone.

Implements: blueprint extract-eventlet
Change-Id: Icacd6f2ee0906ac5d303777c1f87a184f38283bf
This commit is contained in:
Jamie Lennox
2013-05-30 17:48:04 +10:00
committed by Adam Young
parent a012186bb6
commit 3afd9791ef
42 changed files with 212 additions and 139 deletions

View File

@@ -16,8 +16,8 @@
import os
import stat
import subprocess
from keystone.common import environment
from keystone.common import logging
from keystone import config
@@ -77,7 +77,7 @@ class BaseCertificateConfigure(object):
def exec_command(self, command):
to_exec = command % self.ssl_dictionary
LOG.info(to_exec)
subprocess.check_call(to_exec.rsplit(' '))
environment.subprocess.check_call(to_exec.rsplit(' '))
def build_ssl_config_file(self):
if not file_exists(self.ssl_config_file_name):