1 |
commit: 013ae1a327652f270df045b3779f29aaaeb4a2c1 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 1 01:11:42 2012 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 1 01:11:42 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=013ae1a3 |
7 |
|
8 |
fix code in check_setup.py |
9 |
|
10 |
--- |
11 |
gobs/bin/gobs_guest_jobs | 3 ++- |
12 |
gobs/pym/check_setup.py | 17 +++++++++-------- |
13 |
gobs/pym/updatedb.py | 7 ++++--- |
14 |
3 files changed, 15 insertions(+), 12 deletions(-) |
15 |
|
16 |
diff --git a/gobs/bin/gobs_guest_jobs b/gobs/bin/gobs_guest_jobs |
17 |
index 43b8cc1..6fd55ae 100755 |
18 |
--- a/gobs/bin/gobs_guest_jobs |
19 |
+++ b/gobs/bin/gobs_guest_jobs |
20 |
@@ -33,6 +33,7 @@ def main_loop(config_profile): |
21 |
if job is None: |
22 |
CM.putConnection(conn) |
23 |
if check_configure_guest(config_profile) is not True: |
24 |
+ time.sleep(60) |
25 |
continue |
26 |
else: |
27 |
init_queru = queruaction(config_profile) |
28 |
@@ -83,7 +84,7 @@ def main_loop(config_profile): |
29 |
update_job_list(conn, "Fail", job[1]) |
30 |
logging.info("Job %s did fail. Config: %s", job[0], config_profile) |
31 |
repeat = False |
32 |
- time.sleep(10) |
33 |
+ time.sleep(60) |
34 |
CM.putConnection(conn) |
35 |
return |
36 |
|
37 |
|
38 |
diff --git a/gobs/pym/check_setup.py b/gobs/pym/check_setup.py |
39 |
index c0ba2ee..3a5b404 100644 |
40 |
--- a/gobs/pym/check_setup.py |
41 |
+++ b/gobs/pym/check_setup.py |
42 |
@@ -2,6 +2,8 @@ from __future__ import print_function |
43 |
import portage |
44 |
import os |
45 |
import errno |
46 |
+import logging |
47 |
+ |
48 |
from git import * |
49 |
from gobs.text import get_file_text |
50 |
|
51 |
@@ -16,11 +18,10 @@ if CM.getName()=='pgsql': |
52 |
from gobs.pgsql import * |
53 |
|
54 |
def check_make_conf(): |
55 |
- # FIXME: mark any config updating true in the db when updating the configs |
56 |
# Get the config list |
57 |
conn=CM.getConnection() |
58 |
config_list_all = get_config_list_all(conn) |
59 |
- print("Checking configs for changes and errors") |
60 |
+ logging.info("Checking configs for changes and errors") |
61 |
configsDict = {} |
62 |
for config_id in config_list_all: |
63 |
attDict={} |
64 |
@@ -40,20 +41,20 @@ def check_make_conf(): |
65 |
except Exception as e: |
66 |
attDict['config_error'] = e |
67 |
attDict['active'] = 'False' |
68 |
- print("Fail", config_id[0]) |
69 |
+ logging.info("%s FAIL!", config_id[0]) |
70 |
else: |
71 |
attDict['config_error'] = '' |
72 |
attDict['active'] = 'True' |
73 |
- print("Pass", config_id[0]) |
74 |
+ logging.info("%s PASS", config_id[0]) |
75 |
# Get the checksum of make.conf |
76 |
make_conf_checksum_tree = portage.checksum.sha256hash(make_conf_file)[0] |
77 |
- # Check if we have change the make.conf and update the db with it |
78 |
+ logging.info("make.conf checksum is %s on %s", make_conf_checksum_tree, config_id[0]) |
79 |
attDict['make_conf_text'] = get_file_text(make_conf_file) |
80 |
attDict['make_conf_checksum_tree'] = make_conf_checksum_tree |
81 |
- configsDict[config_id]=attDict |
82 |
- update__make_conf(conn,configsDict) |
83 |
+ configsDict[config_id[0]]=attDict |
84 |
+ update__make_conf(conn, configsDict) |
85 |
CM.putConnection(conn) |
86 |
- print("Updated configurtions") |
87 |
+ logging.info("Checking configs for changes and errors ... Done") |
88 |
|
89 |
def check_make_conf_guest(config_profile): |
90 |
conn=CM.getConnection() |
91 |
|
92 |
diff --git a/gobs/pym/updatedb.py b/gobs/pym/updatedb.py |
93 |
index 0277396..f718bc4 100755 |
94 |
--- a/gobs/pym/updatedb.py |
95 |
+++ b/gobs/pym/updatedb.py |
96 |
@@ -103,9 +103,10 @@ def update_cpv_db(mysettings): |
97 |
# Run the update package for all package in the list in |
98 |
# a multiprocessing pool |
99 |
for package_line in sorted(package_list_tree): |
100 |
- pool.apply_async(update_cpv_db_pool, (mysettings, package_line,)) |
101 |
- pool.close() |
102 |
- pool.join() |
103 |
+ update_cpv_db_pool(mysettings, package_line) |
104 |
+ # pool.apply_async(update_cpv_db_pool, (mysettings, package_line,)) |
105 |
+ # pool.close() |
106 |
+ # pool.join() |
107 |
logging.info("Checking categories, package and ebuilds done") |
108 |
|
109 |
def update_db_main(): |