Stop writing to /etc/repos/repos.yaml
authorEd Bartosh <eduard.bartosh@intel.com>
Thu, 18 Sep 2014 08:13:24 +0000 (11:13 +0300)
committerLin A Yang <lin.a.yang@intel.com>
Mon, 29 Sep 2014 00:27:29 +0000 (03:27 +0300)
As BOSS is no more we don't need to write this file. It was used only by
BOSS participants.

Change-Id: I757f206f2421d671810697cf695f7f9b8c1615d3
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
job_load_repos.yaml.py

index 8ee85ab..26fa7c2 100755 (executable)
@@ -8,7 +8,6 @@ This code is called by gerrit-plugin to load the backend config to redis.
 import os
 import sys
 import tempfile
-import yaml
 
 from common.backenddb import BackendDB
 from common.gerrit import get_gerrit_event
@@ -26,28 +25,6 @@ def load_repos(config_file):
                     int(os.getenv('REDIS_PORT')))
     return bdb.read_repos(file(config_file, 'r').read())
 
-def update_repos_conf_on_filesystem(path_to_new_repos_conf,
-                                    path_to_repos_conf="/etc/repos/repos.yaml"):
-    """
-      Temporary solution before BOSS replaced
-
-    Update the repos.yaml files on the filesystem, it request
-    this job runs on the repos server
-
-    Args:
-         path_to_new_repos_conf (str): path to new repos.yaml file location
-         path_to_repos_conf (str): the path of repos.yaml on repos server
-    """
-    with open(path_to_new_repos_conf, 'r') as repo_fh:
-        repos = yaml.load(repo_fh)
-        # add the prefix /srv/ for BOSS
-        for repo in repos['Repositories']:
-            if 'SnapshotDir' in repo:
-                repo['SnapshotDir'] = os.path.join('/srv',
-                                                   repo['SnapshotDir'])
-    with open(path_to_repos_conf, 'w') as repo_fh:
-        repo_fh.write(yaml.dump(repos))
-
 def main():
     """Script entry point.
     """
@@ -69,9 +46,6 @@ def main():
         mygit = Git(prjdir)
         mygit.checkout(event['newrev'])
 
-        # updte repos.yaml on repos server
-        update_repos_conf_on_filesystem(os.path.join(prjdir, 'repos.yaml'))
-
         return load_repos(os.path.join(prjdir, 'repos.yaml'))
 
 if __name__ == '__main__':