~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/auth/manager.py

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-06-17 13:29:16 UTC
  • mto: (94.1.1 raring-proposed)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20110617132916-u3vv6rxmtvnfn4cj
Tags: upstream-2011.3~d2~20110617.1191
ImportĀ upstreamĀ versionĀ 2011.3~d2~20110617.1191

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
LOG = logging.getLogger('nova.auth.manager')
74
74
 
75
75
 
 
76
if FLAGS.memcached_servers:
 
77
    import memcache
 
78
else:
 
79
    from nova import fakememcache as memcache
 
80
 
 
81
 
76
82
class AuthBase(object):
77
83
    """Base class for objects relating to auth
78
84
 
206
212
    """
207
213
 
208
214
    _instance = None
 
215
    mc = None
209
216
 
210
217
    def __new__(cls, *args, **kwargs):
211
218
        """Returns the AuthManager singleton"""
222
229
        self.network_manager = utils.import_object(FLAGS.network_manager)
223
230
        if driver or not getattr(self, 'driver', None):
224
231
            self.driver = utils.import_class(driver or FLAGS.auth_driver)
225
 
 
226
 
        if FLAGS.memcached_servers:
227
 
            import memcache
228
 
        else:
229
 
            from nova import fakememcache as memcache
230
 
        self.mc = memcache.Client(FLAGS.memcached_servers,
231
 
                                  debug=0)
 
232
        if AuthManager.mc is None:
 
233
            AuthManager.mc = memcache.Client(FLAGS.memcached_servers, debug=0)
232
234
 
233
235
    def authenticate(self, access, signature, params, verb='GET',
234
236
                     server_string='127.0.0.1:8773', path='/',