~ubuntu-branches/ubuntu/quantal/keystone/quantal-security

« back to all changes in this revision

Viewing changes to keystone/common/kvs.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-06-22 12:27:50 UTC
  • mto: (35.1.1 quantal-proposed)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: package-import@ubuntu.com-20120622122750-4urdq17en1990apn
Tags: upstream-2012.2~f2~20120622.2353
ImportĀ upstreamĀ versionĀ 2012.2~f2~20120622.2353

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
class DictKvs(dict):
19
19
    def set(self, key, value):
20
 
        if type(value) is type({}):
 
20
        if isinstance(value, dict):
21
21
            self[key] = value.copy()
22
22
        else:
23
23
            self[key] = value[:]
33
33
    def __init__(self, db=None):
34
34
        if db is None:
35
35
            db = INMEMDB
36
 
        elif type(db) is type({}):
 
36
        elif isinstance(db, dict):
37
37
            db = DictKvs(db)
38
38
        self.db = db