~nova-coresec/nova/bexar-translations

« back to all changes in this revision

Viewing changes to nova/tests/test_auth.py

  • Committer: Todd Willey
  • Date: 2011-01-04 05:23:35 UTC
  • mto: (515.6.1 newlog2)
  • mto: This revision was merged to the branch mainline in revision 528.
  • Revision ID: todd@ansolabs.com-20110104052335-rfq4igtasqjv3ux5
Apply logging changes as a giant patch to work around the cloudpipe delete + add issue in the original patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#    License for the specific language governing permissions and limitations
17
17
#    under the License.
18
18
 
19
 
import logging
20
19
from M2Crypto import X509
21
20
import unittest
22
21
 
23
22
from nova import crypto
24
23
from nova import flags
 
24
from nova import log as logging
25
25
from nova import test
26
26
from nova.auth import manager
27
27
from nova.api.ec2 import cloud
28
28
 
29
29
FLAGS = flags.FLAGS
 
30
LOG = logging.getLogger('nova.tests.auth_unittest')
30
31
 
31
32
 
32
33
class user_generator(object):
211
212
            # NOTE(vish): Setup runs genroot.sh if it hasn't been run
212
213
            cloud.CloudController().setup()
213
214
            _key, cert_str = crypto.generate_x509_cert(user.id, project.id)
214
 
            logging.debug(cert_str)
 
215
            LOG.debug(cert_str)
215
216
 
216
217
            full_chain = crypto.fetch_ca(project_id=project.id, chain=True)
217
218
            int_cert = crypto.fetch_ca(project_id=project.id, chain=False)
218
219
            cloud_cert = crypto.fetch_ca()
219
 
            logging.debug("CA chain:\n\n =====\n%s\n\n=====" % full_chain)
 
220
            LOG.debug("CA chain:\n\n =====\n%s\n\n=====", full_chain)
220
221
            signed_cert = X509.load_cert_string(cert_str)
221
222
            chain_cert = X509.load_cert_string(full_chain)
222
223
            int_cert = X509.load_cert_string(int_cert)
331
332
        test.TestCase.__init__(self, *args, **kwargs)
332
333
        import nova.auth.fakeldap as fakeldap
333
334
        if FLAGS.flush_db:
334
 
            logging.info("Flushing datastore")
 
335
            LOG.info("Flushing datastore")
335
336
            r = fakeldap.Store.instance()
336
337
            r.flushdb()
337
338