From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 87FDF1381F3 for ; Sun, 2 Dec 2012 00:06:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 94FBEE066E; Sun, 2 Dec 2012 00:05:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 06BCCE06BE for ; Sun, 2 Dec 2012 00:05:51 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EA10833D996 for ; Sun, 2 Dec 2012 00:05:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7BDB2E5436 for ; Sun, 2 Dec 2012 00:05:49 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1354406735.b88c47083fb9c5a0ab68a7749ceb9dca1428806c.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/pym/check_setup.py X-VCS-Directories: gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: b88c47083fb9c5a0ab68a7749ceb9dca1428806c X-VCS-Branch: master Date: Sun, 2 Dec 2012 00:05:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: e524ee59-3c06-42a1-853b-1d4889e33c89 X-Archives-Hash: eb953382d2067fe69d6e524beb80b539 commit: b88c47083fb9c5a0ab68a7749ceb9dca1428806c Author: Magnus Granberg gentoo org> AuthorDate: Sun Dec 2 00:05:35 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sun Dec 2 00:05:35 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=b88c4708 refix check_make_conf --- gobs/pym/check_setup.py | 81 ++++++++++++++++++++++------------------------- 1 files changed, 38 insertions(+), 43 deletions(-) diff --git a/gobs/pym/check_setup.py b/gobs/pym/check_setup.py index b1a185c..7c9fcad 100644 --- a/gobs/pym/check_setup.py +++ b/gobs/pym/check_setup.py @@ -17,49 +17,44 @@ if CM.getName()=='pgsql': from gobs.pgsql_querys import * def check_make_conf(): - # Get the config list - conn=CM.getConnection() - config_id_list_all = get_config_list_all(conn) - log_msg = "Checking configs for changes and errors" - add_gobs_logs(conn, log_msg, "info", config_profile) - configsDict = {} - for config_id in config_id_list_all: - attDict={} - # Set the config dir - config = get_config(conn, config_id): - check_config_dir = "/var/cache/gobs/" + gobs_settings_dict['gobs_gitreponame'] + "/" + config + "/" - make_conf_file = check_config_dir + "etc/portage/make.conf" - # Check if we can open the file and close it - # Check if we have some error in the file (portage.util.getconfig) - # Check if we envorment error with the config (settings.validate) - try: - open_make_conf = open(make_conf_file) - open_make_conf.close() - portage.util.getconfig(make_conf_file, tolerant=0, allow_sourcing=False, expand=True) - mysettings = portage.config(config_root = check_config_dir) - mysettings.validate() - # With errors we update the db on the config and disable the config - except Exception as e: - attDict['config_error'] = e - attDict['active'] = 'False' - log_msg = "%s FAIL!" % (config,) - add_gobs_logs(conn, log_msg, "info", config_profile) - else: - attDict['config_error'] = '' - attDict['active'] = 'True' - log_msg = "%s PASS" % (config,) - add_gobs_logs(conn, log_msg, "info", config_profile) - # Get the checksum of make.conf - make_conf_checksum_tree = portage.checksum.sha256hash(make_conf_file)[0] - log_msg = "make.conf checksum is %s on %s" % (make_conf_checksum_tree, config,) - add_gobs_logs(conn, log_msg, "info", config_profile) - attDict['make_conf_text'] = get_file_text(make_conf_file) - attDict['make_conf_checksum_tree'] = make_conf_checksum_tree - configsDict[config_id]=attDict - update_make_conf(conn, configsDict) - log_msg = "Checking configs for changes and errors ... Done" - add_gobs_logs(conn, log_msg, "info", config_profile) - CM.putConnection(conn) + # Get the config list + conn=CM.getConnection() + config_id_list_all = get_config_list_all(conn) + log_msg = "Checking configs for changes and errors" + add_gobs_logs(conn, log_msg, "info", config_profile) + configsDict = {} + for config_id in config_id_list_all: + attDict={} + # Set the config dir + config = get_config(conn, config_id): + check_config_dir = "/var/cache/gobs/" + gobs_settings_dict['gobs_gitreponame'] + "/" + config + "/" + make_conf_file = check_config_dir + "etc/portage/make.conf" + # Check if we can take a checksum on it. + # Check if we have some error in the file. (portage.util.getconfig) + # Check if we envorment error with the config. (settings.validate) + try: + make_conf_checksum_tree = portage.checksum.sha256hash(make_conf_file)[0] + portage.util.getconfig(make_conf_file, tolerant=0, allow_sourcing=False, expand=True) + mysettings = portage.config(config_root = check_config_dir) + mysettings.validate() + # With errors we update the db on the config and disable the config + except Exception as e: + attDict['config_error'] = e + attDict['active'] = 'False' + log_msg = "%s FAIL!" % (config,) + add_gobs_logs(conn, log_msg, "info", config_profile) + else: + attDict['config_error'] = '' + attDict['active'] = 'True' + log_msg = "%s PASS" % (config,) + add_gobs_logs(conn, log_msg, "info", config_profile) + attDict['make_conf_text'] = get_file_text(make_conf_file) + attDict['make_conf_checksum_tree'] = make_conf_checksum_tree + configsDict[config_id]=attDict + update_make_conf(conn, configsDict) + log_msg = "Checking configs for changes and errors ... Done" + add_gobs_logs(conn, log_msg, "info", config_profile) + CM.putConnection(conn) def check_make_conf_guest(config_profile): conn=CM.getConnection()