BackendDB: Get rid of latest-snapshot field
authorEd Bartosh <eduard.bartosh@intel.com>
Fri, 28 Jun 2013 11:36:22 +0000 (14:36 +0300)
committerGerrit Code Review <gerrit2@otctools.jf.intel.com>
Mon, 1 Jul 2013 02:29:06 +0000 (19:29 -0700)
All application-level fields should be filled in get_prerelease_data API.
Redis db now contains only data from repos.yaml. if something else is
needed on application level it should be handled in get_prerelease_data
or another application level API.

As latest-snapshot field is not used anywhere it doesn't need to
be moved to get_prerelease_data. So, removing it should be safe.

Change-Id: I442d2be43e8fd1b66a8e6e4e73288b421f0c0f7a
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
common/backenddb.py
tests/test_backenddb.py

index 8fd29ac..090e6d0 100644 (file)
@@ -155,9 +155,6 @@ class BackendDB():
         for repo in repos:
             name = repo.pop('Name')
             names.add(name)
-            # set latest_snapshot attribute as it doesn't exist in repos.yaml
-            repo['latest_snapshot'] = '%s-%s' % (repo['PartOf'],
-                                                 repo['Release'])
             db_repos[name] = repo
 
         # Cleanup entries, which are present in db_list,
index 06a09e6..4e02f82 100644 (file)
@@ -174,7 +174,6 @@ class BackendDBTest(unittest.TestCase):
         bdb = BackendDB()
         bdb.read_repos(REPOS)
         data = {'ProjectConfig': 'True', 'Target': 'standard',
-                'latest_snapshot': 'trunk-release',
                 'Project': 'Project:Repo1',
                 'TopLevel': '/srv/trunk',
                 'SnapshotDir': '/srv/snapshots/trunk',