From: Ed Bartosh Date: Thu, 18 Sep 2014 08:13:24 +0000 (+0300) Subject: Stop writing to /etc/repos/repos.yaml X-Git-Tag: 1.0~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d28be29c313039a489a8918cb44c7c94b2c412d4;p=services%2Fjenkins-scripts.git Stop writing to /etc/repos/repos.yaml 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 --- diff --git a/job_load_repos.yaml.py b/job_load_repos.yaml.py index 8ee85ab..26fa7c2 100755 --- a/job_load_repos.yaml.py +++ b/job_load_repos.yaml.py @@ -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__':