print 'Removing the repo: %s' % path
shutil.rmtree(path)
+def project_src_rpm_cleanup(live_repo_base, project):
+ """ clean src.rpm files on project
+ Args:
+ live_repo_base (str): path to live repo base dir
+ project (str): project name
+ """
+
+ print "==========project_src_rpm_cleanup============"
+ live_path = os.path.join(live_repo_base, project.replace(':', ':/'))
+ print "live_path: %s" % (live_path)
+
+ for root, dirs, files in os.walk(live_path):
+ for filename in files:
+ if 'src.rpm' in filename:
+ print 'rm %s' % (os.path.join(root, filename))
+ os.remove(os.path.join(root, filename))
+
def main(action):
"""Script entry point.
Parameters:
project = content.get("project") or content.get("sourceproject")
+ # cleanup src.rpm files on Live repo
+ # we don't used src.rpm files on prerelease project.
+ project_src_rpm_cleanup(live_repo_base,project)
+
build = BuildService(obs_api, obs_user, obs_passwd)
# Init backend database