Revert scoped lock format

Recently scoped lock format was mistakenly changed
from "type_name:name:version" to "owner". New format
prevents simultaneuos modifications of different 
artifacts by one tenant, because it locks the whole
tenant scope, not just a single artifact.

For this reason it's suggested to revert the format as
it was before.

Closes-bug: #1720139

Change-Id: I9dc26da85f424a4ced1ca232d1f33c548b602f0f
This commit is contained in:
Mike Fedosin 2017-09-27 18:55:37 +03:00
parent a30cdaf6a9
commit d2ce390ca8
1 changed files with 3 additions and 4 deletions

View File

@ -93,10 +93,9 @@ class Engine(object):
filters.extend([('owner', 'eq:' + owner),
('visibility', 'private')])
scope_id = owner
if visibility == 'public':
scope_id = "%s:%s:%s" % (type_name, name, version)
scope_id = "%s:%s:%s" % (type_name, name, version)
if visibility != 'public':
scope_id += ':%s' % owner
lock = self.lock_engine.acquire(context, scope_id)
try: