1 |
commit: d03e1c767009281dcdad253882d48ec18da49a26 |
2 |
Author: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 29 15:58:30 2012 +0000 |
4 |
Commit: Magnus Granberg <zorry <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 29 15:58:30 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/zorry.git;a=commit;h=d03e1c76 |
7 |
|
8 |
fix a typo in gobs_host_jobs |
9 |
|
10 |
--- |
11 |
gobs/bin/gobs_host_jobs | 2 +- |
12 |
gobs/bin/gobs_host_jobs~ | 55 ---------------------------------------------- |
13 |
2 files changed, 1 insertions(+), 56 deletions(-) |
14 |
|
15 |
diff --git a/gobs/bin/gobs_host_jobs b/gobs/bin/gobs_host_jobs |
16 |
index c5d80a1..1eac84a 100755 |
17 |
--- a/gobs/bin/gobs_host_jobs |
18 |
+++ b/gobs/bin/gobs_host_jobs |
19 |
@@ -41,7 +41,7 @@ def main(): |
20 |
update_job_list(conn, "Runing", job[1]) |
21 |
logging.info("Job %s is runing. Config: %s", job[0], config_profile) |
22 |
result = update_db_main() |
23 |
- if result is True |
24 |
+ if result is True: |
25 |
update_job_list(conn, "Done", job[1]) |
26 |
logging.info("Job %s is done. Config: %s", job[0], config_profile) |
27 |
else: |
28 |
|
29 |
diff --git a/gobs/bin/gobs_host_jobs~ b/gobs/bin/gobs_host_jobs~ |
30 |
deleted file mode 100755 |
31 |
index 87e856e..0000000 |
32 |
--- a/gobs/bin/gobs_host_jobs~ |
33 |
+++ /dev/null |
34 |
@@ -1,55 +0,0 @@ |
35 |
-#!/usr/bin/python |
36 |
-# Copyright 2006-2011 Gentoo Foundation |
37 |
-# Distributed under the terms of the GNU General Public License v2 |
38 |
- |
39 |
-from __future__ import print_function |
40 |
- |
41 |
-from gobs.init_setup_profile import setup_profile_main |
42 |
-from gobs.readconf import get_conf_settings |
43 |
-from gobs.updatedb import update_db_main |
44 |
- |
45 |
-reader = get_conf_settings() |
46 |
-gobs_settings_dict=reader.read_gobs_settings_all() |
47 |
- |
48 |
-# make a CM |
49 |
-from gobs.ConnectionManager import connectionManager |
50 |
-CM=connectionManager(gobs_settings_dict) |
51 |
-#selectively import the pgsql/mysql querys |
52 |
-if CM.getName()=='pgsql': |
53 |
- from gobs.pgsql import * |
54 |
-import logging |
55 |
- |
56 |
-def main(): |
57 |
- # Main |
58 |
- config_profile = gobs_settings_dict['gobs_config'] |
59 |
- # Logging |
60 |
- logging.basicConfig(filename=gobs_settings_dict['gobs_logfile'], \ |
61 |
- format='%(levelname)s: %(asctime)s %(message)s', level=logging.INFO) |
62 |
- repeat = True |
63 |
- logging.info("Job deamon started.") |
64 |
- while repeat: |
65 |
- conn = CM.getConnection() |
66 |
- job = check_job_list(conn, config_profile) |
67 |
- |
68 |
- if job is None: |
69 |
- time.sleep(60) |
70 |
- CM.putConnection(conn) |
71 |
- continue |
72 |
- else: |
73 |
- logging.info("Job: %s Type: %s Config: %s", job[1], job[0], config_profile) |
74 |
- if job[0] == "updatedb": |
75 |
- update_job_list(conn, "Runing", job[1]) |
76 |
- logging.info("Job %s is runing. Config: %s", job[0], config_profile) |
77 |
- result = update_db_main() |
78 |
- if result is True |
79 |
- update_job_list(conn, "Done", job[1]) |
80 |
- logging.info("Job %s is done. Config: %s", job[0], config_profile) |
81 |
- else: |
82 |
- update_job_list(conn, "Fail", job[1]) |
83 |
- logging.info("Job %s did fail. Config: %s", job[0], config_profile) |
84 |
- repeat = False |
85 |
- CM.putConnection(conn) |
86 |
- time.sleep(60) |
87 |
- |
88 |
-if __name__ == "__main__": |
89 |
- main() |
90 |
\ No newline at end of file |