rel-eng/packages schema/spacewalk
by Milan Zazrivec
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 1e2c5dae217a50581cea52c21ff0839ff900f109
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Aug 3 09:30:14 2010 +0200
Automatic commit of package [spacewalk-schema] release [1.1.25-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index baef8d2..222ff51 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.1.24-1 schema/spacewalk/
+1.1.25-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 62e33a9..5102321 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.1.24
+Version: 1.1.25
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -59,6 +59,13 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-schema-upgrade*
%changelog
+* Tue Aug 03 2010 Milan Zazrivec <mzazrivec(a)redhat.com> 1.1.25-1
+- Do not depend on cpp when sed works just as well
+- The slash is not needed as it causes the create index command to be run for
+ the second time, during raw db population
+- Underscore is not valid syntax during raw db population
+- Empty line in the create table command causes error during raw db population
+
* Thu Jul 29 2010 Partha Aji <paji(a)redhat.com> 1.1.24-1
- fixing a few things with the new config changes for symlinks
(jsherril(a)redhat.com)
13 years, 9 months
Changes to 'refs/tags/rhncfg-5.9.25-1'
by Partha Aji
Tag 'rhncfg-5.9.25-1' created by Partha Aji <paji(a)redhat.com> at 2010-08-02 23:39 +0000
Tagging package [rhncfg] version [5.9.25-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-java-1.1.43-1:
Partha Aji (3):
Changes to rhncfg verify and diff to get symlinks working
Added diff and get functionaliity for rhncfg-manager
Automatic commit of package [rhncfg] release [5.9.25-1].
---
client/tools/rhncfg/config_client/rhncfgcli_diff.py | 15 -
client/tools/rhncfg/config_client/rhncfgcli_elist.py | 3
client/tools/rhncfg/config_client/rhncfgcli_verify.py | 165 +++++++++---------
client/tools/rhncfg/config_common/file_utils.py | 2
client/tools/rhncfg/config_management/rhncfg_diff.py | 15 +
client/tools/rhncfg/config_management/rhncfg_get.py | 3
client/tools/rhncfg/rhncfg.spec | 6
rel-eng/packages/rhncfg | 2
8 files changed, 115 insertions(+), 96 deletions(-)
---
13 years, 9 months
client/tools rel-eng/packages
by Partha Aji
client/tools/rhncfg/rhncfg.spec | 6 +++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 0df997280371f07490b76a4cbc9c302cc6f65a6b
Author: Partha Aji <paji(a)redhat.com>
Date: Mon Aug 2 19:39:16 2010 -0400
Automatic commit of package [rhncfg] release [5.9.25-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 127d9b7..bfcbfc6 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2 and Python
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.24
+Version: 5.9.25
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -99,6 +99,10 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Mon Aug 02 2010 Partha Aji <paji(a)redhat.com> 5.9.25-1
+- Added diff and get functionaliity for rhncfg-manager (paji(a)redhat.com)
+- Changes to rhncfg verify and diff to get symlinks working (paji(a)redhat.com)
+
* Thu Jul 29 2010 Partha Aji <paji(a)redhat.com> 5.9.24-1
- Made the diff in operation rhncfg client work with symlinks (paji(a)redhat.com)
- Config Management schema update + ui + symlinks (paji(a)redhat.com)
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index bef1d6f..f96e179 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.9.24-1 client/tools/rhncfg/
+5.9.25-1 client/tools/rhncfg/
13 years, 9 months
client/tools
by Partha Aji
client/tools/rhncfg/config_management/rhncfg_diff.py | 15 ++++++++++++---
client/tools/rhncfg/config_management/rhncfg_get.py | 3 +++
2 files changed, 15 insertions(+), 3 deletions(-)
New commits:
commit 82c954dc133d7c8c318b92c5e8bb6ba7aae02b93
Author: Partha Aji <paji(a)redhat.com>
Date: Mon Aug 2 19:38:47 2010 -0400
Added diff and get functionaliity for rhncfg-manager
diff --git a/client/tools/rhncfg/config_management/rhncfg_diff.py b/client/tools/rhncfg/config_management/rhncfg_diff.py
index 948510a..f036018 100644
--- a/client/tools/rhncfg/config_management/rhncfg_diff.py
+++ b/client/tools/rhncfg/config_management/rhncfg_diff.py
@@ -86,12 +86,12 @@ class Handler(handler_base.HandlerBase):
if not utils.startswith(f, topdir):
die(8, "--topdir %s specified, but file `%s' doesn't comply"
% (topdir, f))
- if os.path.isdir(f):
+ if os.path.isdir(f) and not os.path.islink(f):
die(8, "Cannot diff %s; it is a directory" % f)
files_to_diff.append((f, f[len(topdir):]))
else:
for f in files:
- if os.path.isdir(f):
+ if os.path.isdir(f) and not os.path.islink(f):
die(8, "Cannot diff %s; it is a directory" % f)
files_to_diff.append((f, f))
@@ -108,7 +108,16 @@ class Handler(handler_base.HandlerBase):
except cfg_exceptions.RepositoryFileMissingError:
die(2, "Error: no such file %s (revision %s) in config channel %s"
% (path, revision, channel))
-
+ if os.path.islink(local_file) and info['filetype'] != 'symlink' :
+ die(8, "Cannot diff %s; the file on the system is a symbolic link while the file in the channel is not. " % local_file)
+ if info['filetype'] != 'symlink' and not os.path.islink(local_file) :
+ die(8, "Cannot diff %s; the file on the system is not a symbolic link while the file in the channel is. " % local_file)
+ if info['filetype'] == 'symlink':
+ src_link = info['symlink']
+ dest_link = os.readlink(local_file)
+ if src_link != os.readlink(local_file):
+ return "Symbolic links differ. Channel: '%s' -> '%s' System: '%s' -> '%s' \n " % (path,src_link, path, dest_link)
+ return ""
# Test -u option to diff
diffcmd = "/usr/bin/diff -u"
pipe = os.popen("%s %s %s 2>/dev/null" % (diffcmd, temp_file, local_file))
diff --git a/client/tools/rhncfg/config_management/rhncfg_get.py b/client/tools/rhncfg/config_management/rhncfg_get.py
index 8bb8552..e502160 100644
--- a/client/tools/rhncfg/config_management/rhncfg_get.py
+++ b/client/tools/rhncfg/config_management/rhncfg_get.py
@@ -93,6 +93,9 @@ class Handler(handler_base.HandlerBase):
#5/11/05 wregglej - 157066 dirs_created now gets passed into add_preprocessed.
dep_trans.add_preprocessed(f, temp_file, info, dirs_created, strict_ownership=0)
continue
+ elif info.get('filetype') == 'symlink':
+ print "%s -> %s" % (info['path'], info['symlink'])
+ continue
elif info.get('filetype') == 'directory':
print "%s is a directory entry, nothing to get" % info['path']
continue
13 years, 9 months
client/tools
by Partha Aji
client/tools/rhncfg/config_client/rhncfgcli_diff.py | 15 -
client/tools/rhncfg/config_client/rhncfgcli_elist.py | 3
client/tools/rhncfg/config_client/rhncfgcli_verify.py | 165 +++++++++---------
client/tools/rhncfg/config_common/file_utils.py | 2
4 files changed, 94 insertions(+), 91 deletions(-)
New commits:
commit a98d14e554101131374fa2a740aa3651bbfd6578
Author: Partha Aji <paji(a)redhat.com>
Date: Mon Aug 2 18:36:37 2010 -0400
Changes to rhncfg verify and diff to get symlinks working
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_diff.py b/client/tools/rhncfg/config_client/rhncfgcli_diff.py
index 10c928a..26ea026 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_diff.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_diff.py
@@ -31,20 +31,13 @@ class Handler(handler_base.HandlerBase):
# output. also gets rid of /tmp/@blah in diff output.
label = dst
- if type == 'directory':
- #dst is a directory, so just tell the user we're skipping the entry
- print "Entry \'%s\' is a directory, skipping" % dst
- elif type == 'symlink':
+ if type == 'symlink':
#dst is a symlink, so just tell the user we're skipping the entry
srclink = os.path.abspath(os.readlink(src))
destlink = os.path.abspath(os.readlink(dst))
- if srclink == destlink:
- print "No change between the symbolic links '%s' " % dst
- else:
- print "Symbolic link targets are different."
- print "Channel: '%s' -> '%s' System: '%s' -> '%s' " % (dst,srclink, dst, destlink)
-
- else:
+ if srclink != destlink:
+ print "Symbolic links differ. Channel: '%s' -> '%s' System: '%s' -> '%s' " % (dst,srclink, dst, destlink)
+ elif type == 'file':
# if file isn't present, compare to /dev/null so we see the
# whole thing in the diff
if not os.access(dst, os.R_OK):
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_elist.py b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
index dcb5102..a88822f 100755
--- a/client/tools/rhncfg/config_client/rhncfgcli_elist.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
@@ -101,5 +101,6 @@ class Handler(handler_base.HandlerBase):
fsize = '*' + str(len(finfo['file_contents']))
permstr = finfo['filetype'] != 'symlink' and self.ostr_to_sym(finfo['filemode'], finfo['filetype']) or ''
- print "%10s %8s %-8s %10s %+3s %*s %s" % (permstr, finfo['username'], finfo['groupname'], fsize, finfo['revision'], maxlen, file[0], file[1])
+ dest = finfo['filetype'] != 'symlink' and file[1] or "%s -> %s" % (file[1], finfo['symlink'])
+ print "%10s %8s %-8s %10s %+3s %*s %s" % (permstr, finfo['username'], finfo['groupname'], fsize, finfo['revision'], maxlen, file[0], dest)
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_verify.py b/client/tools/rhncfg/config_client/rhncfgcli_verify.py
index caa30b5..3fbddf3 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_verify.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_verify.py
@@ -169,95 +169,104 @@ class Handler(handler_base.HandlerBase):
selinux_report = "%s|%s"
src, dst, file, type, info = args[:5]
+ owner_status = ""
+ group_status = ""
+ perm_status = ""
+ selinux_status = ""
status = []
stat_err = 0
-
- #Stat the destination file
- try:
- dst_stat = os.lstat(dst)
- except:
- stat_err = 1
-
- src_user = info['username']
- if not stat_err:
- #check for owner differences
- dst_uid = dst_stat[stat.ST_UID]
- try:
- dst_user = pwd.getpwuid(dst_uid)[0]
- except KeyError:
- # Orphan UID with no name,return unknown
- dst_user = "unknown(UID %d)" % (dst_uid,)
- else:
- dst_user = "missing"
-
- #owner_status gets displayed with the verbose option.
- if src_user == dst_user:
- owner_status = ""
- else:
- owner_status = owner_report % (src_user, dst_user)
- status.append('user')
-
- src_group = info['groupname']
- if not stat_err:
- #check for group differences
- dst_gid = dst_stat[stat.ST_GID]
+ if type != 'symlink':
+ #Stat the destination file
try:
- dst_group = grp.getgrgid(dst_gid)[0]
- except KeyError:
- # Orphan GID with no name,return unknown
- dst_group = "unknown(GID %d)" % (dst_gid,)
- else:
- dst_group = "missing"
-
- #group_status gets displayed with the verbose option.
- if src_group == dst_group:
- group_status = ""
- else:
- group_status = group_report % (src_group, dst_group)
- status.append('group')
-
- #check for permissions differences
- src_perm = str(info['filemode'])
- if not stat_err:
- #The mode returned by stat is decimal, but won't match the value in file_info unless it's octal.
- #Unfortunately, the mode in file_info looks like the octal value of the mode, except it's in decimal.
- #The solution I came up with is to convert them both into strings, rip off the leading '0' from the
- #mode returned by stat, use the resulting strings. It sucks, but it seems to work (for now).
- dst_perm = str(oct(stat.S_IMODE(dst_stat[stat.ST_MODE])))
- else:
- dst_perm = "missing"
-
- #rip off the leading '0' from the mode returned by stat()
- if dst_perm[0] == '0':
- dst_perm = dst_perm[1:]
-
- #perm_status gets displayed with the verbose option.
- if src_perm == dst_perm:
- perm_status = ""
- else:
- perm_status = perm_report % (src_perm, dst_perm)
- status.append('mode')
+ dst_stat = os.lstat(dst)
+ except:
+ stat_err = 1
+
+ src_user = info['username']
+ if not stat_err:
+ #check for owner differences
+ dst_uid = dst_stat[stat.ST_UID]
+ try:
+ dst_user = pwd.getpwuid(dst_uid)[0]
+ except KeyError:
+ # Orphan UID with no name,return unknown
+ dst_user = "unknown(UID %d)" % (dst_uid,)
+ else:
+ dst_user = "missing"
+
+ #owner_status gets displayed with the verbose option.
+ if src_user == dst_user:
+ owner_status = ""
+ else:
+ owner_status = owner_report % (src_user, dst_user)
+ status.append('user')
+
+ src_group = info['groupname']
+ if not stat_err:
+ #check for group differences
+ dst_gid = dst_stat[stat.ST_GID]
+ try:
+ dst_group = grp.getgrgid(dst_gid)[0]
+ except KeyError:
+ # Orphan GID with no name,return unknown
+ dst_group = "unknown(GID %d)" % (dst_gid,)
+ else:
+ dst_group = "missing"
+
+ #group_status gets displayed with the verbose option.
+ if src_group == dst_group:
+ group_status = ""
+ else:
+ group_status = group_report % (src_group, dst_group)
+ status.append('group')
+
+ #check for permissions differences
+ src_perm = str(info['filemode'])
+ if not stat_err:
+ #The mode returned by stat is decimal, but won't match the value in file_info unless it's octal.
+ #Unfortunately, the mode in file_info looks like the octal value of the mode, except it's in decimal.
+ #The solution I came up with is to convert them both into strings, rip off the leading '0' from the
+ #mode returned by stat, use the resulting strings. It sucks, but it seems to work (for now).
+ dst_perm = str(oct(stat.S_IMODE(dst_stat[stat.ST_MODE])))
+ else:
+ dst_perm = "missing"
+
+ #rip off the leading '0' from the mode returned by stat()
+ if dst_perm[0] == '0':
+ dst_perm = dst_perm[1:]
+
+ #perm_status gets displayed with the verbose option.
+ if src_perm == dst_perm:
+ perm_status = ""
+ else:
+ perm_status = perm_report % (src_perm, dst_perm)
+ status.append('mode')
# compare selinux contexts
src_selinux = info['selinux_ctx']
- if not stat_err:
- dst_selinux = lgetfilecon(dst)[1]
- if dst_selinux == None:
- dst_selinux = ""
- else:
- dst_selinux = "missing"
-
- if src_selinux == dst_selinux:
- selinux_status = ""
- else:
- selinux_status = selinux_report % (src_selinux, dst_selinux)
- status.append('selinux')
+ if src_selinux:
+ if not stat_err:
+ dst_selinux = lgetfilecon(dst)[1]
+ if dst_selinux == None:
+ dst_selinux = ""
+ else:
+ dst_selinux = "missing"
+
+ if src_selinux == dst_selinux:
+ selinux_status = ""
+ else:
+ selinux_status = selinux_report % (src_selinux, dst_selinux)
+ status.append('selinux')
#figure out the ultimate value of status.
if stat_err:
status = ["missing"]
-
+ elif type == 'symlink':
+ if not os.path.islink(file):
+ status = ["missing"]
+ elif os.readlink(file) != info['symlink']:
+ status.append('target-link-modified')
elif type == 'directory':
if not os.path.isdir(file):
status = ["missing"]
diff --git a/client/tools/rhncfg/config_common/file_utils.py b/client/tools/rhncfg/config_common/file_utils.py
index 6325c39..1a1b333 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -98,7 +98,7 @@ class FileProcessor:
cur_sectx = lgetfilecon(path)[1]
if cur_sectx == None:
cur_sectx = ''
- if file_struct.has_key('selinux_ctx'):
+ if file_struct.has_key('selinux_ctx') and file_struct['selinux_ctx']:
if cur_sectx != file_struct['selinux_ctx']:
sectx_result = "SELinux contexts differ: actual: [%s], expected: [%s]\n" % (cur_sectx, file_struct['selinux_ctx'])
13 years, 9 months
Changes to 'refs/tags/spacewalk-java-1.1.43-1'
by Milan Zazrivec
Tag 'spacewalk-java-1.1.43-1' created by Milan Zazrivec <mzazrivec(a)redhat.com> at 2010-08-02 16:57 +0000
Tagging package [spacewalk-java] version [1.1.43-1] in directory [java/].
Changes since spacewalk-java-1.1.42-1:
Milan Zazrivec (2):
use objectweb-asm for Fedora-13 and beyond
Automatic commit of package [spacewalk-java] release [1.1.43-1].
---
java/spacewalk-java.spec | 7 +++++--
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
---
13 years, 9 months
java/spacewalk-java.spec rel-eng/packages
by Milan Zazrivec
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit eec07572f3a43ad0c5ba19f1d99d1d588593dfaf
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Aug 2 18:57:41 2010 +0200
Automatic commit of package [spacewalk-java] release [1.1.43-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 7367219..6f79c4b 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.1.42
+Version: 1.1.43
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -331,6 +331,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Mon Aug 02 2010 Milan Zazrivec <mzazrivec(a)redhat.com> 1.1.43-1
+- use objectweb-asm for Fedora-13 and beyond
+
* Mon Aug 02 2010 Milan Zazrivec <mzazrivec(a)redhat.com> 1.1.42-1
- point taskomatic to slf4j jars
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 27cd604..05bc5a3 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.1.42-1 java/
+1.1.43-1 java/
13 years, 9 months
java/spacewalk-java.spec
by Milan Zazrivec
java/spacewalk-java.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 54ce484ee00c3c81a94093632f89daa379c4ec61
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Aug 2 18:54:33 2010 +0200
use objectweb-asm for Fedora-13 and beyond
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index e706408..7367219 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -257,7 +257,7 @@ ln -s -f %{cobdirsnippets} $RPM_BUILD_ROOT/%{realcobsnippetsdir}/spacewalk
touch $RPM_BUILD_ROOT/%{_var}/spacewalk/systemlogs/audit-review.log
-%if 0%{?rhel} && 0%{?rhel} < 6
+%if (0%{?rhel} && 0%{?rhel} < 6) || (0%{?fedora} && 0%{?fedora} < 13)
ln -s -f %{_javadir}/asm/asm.jar $RPM_BUILD_ROOT/%{_datadir}/rhn/lib/spacewalk-asm.jar
%else
ln -s -f %{_javadir}/objectweb-asm/asm.jar $RPM_BUILD_ROOT/%{_datadir}/rhn/lib/spacewalk-asm.jar
13 years, 9 months
Branch 'taskomatic' - 5 commits - java/code schema/spacewalk
by Tomas Lestach
java/code/src/com/redhat/rhn/common/hibernate/ConnectionManager.java | 46 +++---
java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java | 32 ++--
java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskException.java | 29 ---
java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskoTriggerException.java | 25 ---
java/code/src/com/redhat/rhn/taskomatic/TaskoJob.java | 9 -
java/code/src/com/redhat/rhn/taskomatic/TaskoRun.java | 4
java/code/src/com/redhat/rhn/taskomatic/core/RhnJobFactory.java | 4
java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java | 63 +-------
java/code/src/com/redhat/rhn/taskomatic/task/ChannelRepodata.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/ErrataMailer.java | 1
java/code/src/com/redhat/rhn/taskomatic/task/ErrataQueue.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/JobFactory.java | 41 -----
java/code/src/com/redhat/rhn/taskomatic/task/KickstartCleanup.java | 1
java/code/src/com/redhat/rhn/taskomatic/task/RhnExtCmdJob.java | 68 ---------
java/code/src/com/redhat/rhn/taskomatic/task/RhnJob.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/RhnQueueJob.java | 15 +-
java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTask.java | 75 ----------
java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTestableTask.java | 71 ---------
java/code/src/com/redhat/rhn/taskomatic/task/TestableTask.java | 36 ----
java/code/src/com/redhat/rhn/taskomatic/task/repomd/ChannelRepodataDriver.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/threaded/QueueDriver.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueue.java | 2
java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueueFactory.java | 3
schema/spacewalk/common/data/rhnDaemonState.sql | 35 ----
24 files changed, 84 insertions(+), 486 deletions(-)
New commits:
commit 13fa9f458fcfa149ef03432d13292d0254f8091c
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Aug 2 12:13:53 2010 +0200
separate tomcat and taskomatic hbm.xml files
diff --git a/java/code/src/com/redhat/rhn/common/hibernate/ConnectionManager.java b/java/code/src/com/redhat/rhn/common/hibernate/ConnectionManager.java
index c9cbd35..65bb469 100644
--- a/java/code/src/com/redhat/rhn/common/hibernate/ConnectionManager.java
+++ b/java/code/src/com/redhat/rhn/common/hibernate/ConnectionManager.java
@@ -38,10 +38,10 @@ import java.util.Properties;
* @version $Rev$
*/
class ConnectionManager {
-
+
private static final Logger LOG = Logger.getLogger(ConnectionManager.class);
- private static final String[] PACKAGE_NAMES = {"com.redhat.rhn.domain", "com.redhat.rhn.taskomatic"};
-
+ private static final String[] PACKAGE_NAMES = {"com.redhat.rhn.domain"};
+
private List configurators = new LinkedList();
private SessionFactory sessionFactory;
private ThreadLocal SESSION_TLS = new ThreadLocal() {
@@ -51,8 +51,14 @@ class ConnectionManager {
return result;
}
};
+ private String[] packageNames = PACKAGE_NAMES;
-
+ /**
+ * enable possibility to load hbm.xml files from different path
+ */
+ void setAlternatePackageNames(String[] packageNamesIn) {
+ packageNames = packageNamesIn;
+ }
/**
* Register a class with HibernateFactory, to give the registered class a
@@ -66,7 +72,7 @@ class ConnectionManager {
// so it isn't a real race condition.
configurators.add(c);
}
-
+
public boolean isTransactionPending() {
boolean retval = false;
SessionInfo info = threadSessionInfo();
@@ -75,7 +81,7 @@ class ConnectionManager {
}
return retval;
}
-
+
public ClassMetadata getMetadata(Object target) {
ClassMetadata retval = null;
if (target != null) {
@@ -88,7 +94,7 @@ class ConnectionManager {
}
return retval;
}
-
+
/**
* Close the sessionFactory
*/
@@ -103,15 +109,15 @@ class ConnectionManager {
sessionFactory = null;
}
}
-
+
public boolean isClosed() {
return sessionFactory == null;
}
-
+
public boolean isInitialized() {
return sessionFactory != null;
}
-
+
public synchronized void initialize() {
if (isInitialized()) {
return;
@@ -130,15 +136,15 @@ class ConnectionManager {
}
List hbms = new LinkedList();
-
- for (int i = 0; i < PACKAGE_NAMES.length; i++) {
- hbms.addAll(FinderFactory.getFinder(PACKAGE_NAMES[i]).find(
+
+ for (int i = 0; i < packageNames.length; i++) {
+ hbms.addAll(FinderFactory.getFinder(packageNames[i]).find(
"hbm.xml"));
if (LOG.isDebugEnabled()) {
LOG.debug("Found: " + hbms);
}
}
-
+
try {
Configuration config = new Configuration();
/*
@@ -156,7 +162,7 @@ class ConnectionManager {
" can not be set in a configuration file;" +
" it is set to a fixed value by the code");
}
-
+
for (Iterator i = hbms.iterator(); i.hasNext();) {
String hbmFile = (String) i.next();
if (LOG.isDebugEnabled()) {
@@ -237,7 +243,7 @@ class ConnectionManager {
}
return getInternalSession();
}
-
+
private Session getInternalSession() {
SessionInfo info = threadSessionInfo();
if (info == null ||
@@ -255,9 +261,9 @@ class ConnectionManager {
}
SESSION_TLS.set(info);
}
-
+
return info.getSession();
-
+
}
/**
@@ -283,7 +289,7 @@ class ConnectionManager {
catch (HibernateException e) {
LOG.error(e);
}
- finally {
+ finally {
if (session != null) {
try {
if (session.isOpen()) {
@@ -304,5 +310,5 @@ class ConnectionManager {
SESSION_TLS.set(null);
}
}
- }
+ }
}
diff --git a/java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java b/java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java
index 726c363..2088ed2 100644
--- a/java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java
+++ b/java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java
@@ -54,7 +54,7 @@ import java.util.Set;
* @version $Rev$
*/
public abstract class HibernateFactory {
-
+
private static ConnectionManager connectionManager = new ConnectionManager();
private static final Logger LOG = Logger.getLogger(HibernateFactory.class);
@@ -95,6 +95,16 @@ public abstract class HibernateFactory {
}
/**
+ * Create a SessionFactory, loading the hbm.xml files from alternate
+ * location
+ * @param alternateLocation Alternate location for hbm.xml files
+ */
+ public static void createSessionFactory(String[] alternateLocation) {
+ connectionManager.setAlternatePackageNames(alternateLocation);
+ connectionManager.initialize();
+ }
+
+ /**
* Get the Logger for the derived class so log messages show up on the
* correct class
* @return Logger for this class.
@@ -335,7 +345,7 @@ public abstract class HibernateFactory {
public static boolean inTransaction() {
return connectionManager.isTransactionPending();
}
-
+
/**
* Closes the Hibernate Session stored in ThreadLocal storage.
*/
@@ -441,10 +451,10 @@ public abstract class HibernateFactory {
* utility to convert blob to String
* @param fromBlob blob to convert
* @return String converted from blob
- */
+ */
public static String blobToString(Blob fromBlob) {
if (fromBlob != null) {
- return getByteArrayContents(blobToByteArray(fromBlob));
+ return getByteArrayContents(blobToByteArray(fromBlob));
}
return "";
}
@@ -497,7 +507,7 @@ public abstract class HibernateFactory {
retval = new String(barr, "UTF-8");
}
catch (UnsupportedEncodingException uee) {
- throw new RuntimeException("Illegal Argument: " +
+ throw new RuntimeException("Illegal Argument: " +
"This VM or environment doesn't support UTF-8: Data - " +
barr, uee);
}
@@ -536,18 +546,18 @@ public abstract class HibernateFactory {
if (StringUtils.isEmpty(data)) {
return null;
}
-
+
try {
return byteArrayToBlob(data.getBytes("UTF-8"));
}
catch (UnsupportedEncodingException e) {
- throw new RuntimeException("Illegal Argument: " +
+ throw new RuntimeException("Illegal Argument: " +
"This VM or environment doesn't support UTF-8 - Data - " +
data, e);
}
- }
-
-
+ }
+
+
/**
* Initialize the underlying db layer
*
@@ -555,7 +565,7 @@ public abstract class HibernateFactory {
public static void initialize() {
connectionManager.initialize();
}
-
+
/**
* Returns the current initialization status
* @return boolean current status
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
index 2b516d2..bb87bcf 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
@@ -36,6 +36,7 @@ import java.util.Properties;
*/
public class SchedulerKernel {
+ private static final String[] TASKOMATIC_PACKAGE_NAMES = {"com.redhat.rhn.taskomatic"};
private static Logger log = Logger.getLogger(SchedulerKernel.class);
private byte[] shutdownLock = new byte[0];
private static SchedulerFactory factory = null;
@@ -109,7 +110,7 @@ public class SchedulerKernel {
* @throws TaskomaticException error occurred during Quartz or Hibernate startup
*/
public void startup() throws TaskomaticException {
- HibernateFactory.createSessionFactory();
+ HibernateFactory.createSessionFactory(TASKOMATIC_PACKAGE_NAMES);
if (!HibernateFactory.isInitialized()) {
throw new TaskomaticException("HibernateFactory failed to initialize");
}
commit 966964c02aaae00b494860fd8bbce0d1e7df1071
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jul 27 17:57:58 2010 +0200
remove unused parts
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/RhnJobFactory.java b/java/code/src/com/redhat/rhn/taskomatic/core/RhnJobFactory.java
index 7eefc1d..bfac99f 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/RhnJobFactory.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/RhnJobFactory.java
@@ -15,7 +15,6 @@
package com.redhat.rhn.taskomatic.core;
import com.redhat.rhn.taskomatic.TaskoJob;
-import com.redhat.rhn.taskomatic.TaskoSchedule;
import org.quartz.Job;
import org.quartz.SchedulerException;
@@ -26,7 +25,7 @@ import org.quartz.spi.TriggerFiredBundle;
/**
* A custom Quartz JobFactory implementation which insures that
* only one instance of a job class is every instantiated.
- *
+ *
* @version $Rev: 75283 $
*/
public class RhnJobFactory implements JobFactory {
@@ -34,7 +33,6 @@ public class RhnJobFactory implements JobFactory {
* {@inheritDoc}
*/
public synchronized Job newJob(TriggerFiredBundle trigger) throws SchedulerException {
- TaskoSchedule schedule = null;
Long scheduleId = trigger.getJobDetail().getJobDataMap().getLong("schedule_id");
return new TaskoJob(scheduleId);
diff --git a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
index 41935fe..2b516d2 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/core/SchedulerKernel.java
@@ -22,17 +22,12 @@ import com.redhat.rhn.common.messaging.MessageQueue;
import com.redhat.rhn.taskomatic.TaskoXmlRpcServer;
import org.apache.log4j.Logger;
-import org.quartz.CronTrigger;
-import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
-import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
import java.net.UnknownHostException;
-import java.util.Iterator;
-import java.util.Map;
import java.util.Properties;
/**
@@ -40,7 +35,7 @@ import java.util.Properties;
* @version $Rev$
*/
public class SchedulerKernel {
-
+
private static Logger log = Logger.getLogger(SchedulerKernel.class);
private byte[] shutdownLock = new byte[0];
private static SchedulerFactory factory = null;
@@ -51,7 +46,7 @@ public class SchedulerKernel {
private String dataSourcePrefix = "org.quartz.dataSource";
private String defaultDataSource = "rhnDs";
-
+
/**
* Kernel main driver behind Taskomatic
* @throws InstantiationException thrown if this.scheduler can't be initialized.
@@ -82,7 +77,7 @@ public class SchedulerKernel {
SchedulerKernel.factory = new StdSchedulerFactory(props);
SchedulerKernel.scheduler = SchedulerKernel.factory.getScheduler();
SchedulerKernel.scheduler.setJobFactory(new RhnJobFactory());
-
+
// Setup TriggerListener chain
this.chainedTriggerListener = new ChainedListener();
this.chainedTriggerListener.addListener(new TaskEnvironmentListener());
@@ -107,7 +102,7 @@ public class SchedulerKernel {
public static Scheduler getScheduler() {
return SchedulerKernel.scheduler;
}
-
+
/**
* Starts Taskomatic
* This method does not return until the this.scheduler is shutdown
@@ -135,7 +130,7 @@ public class SchedulerKernel {
throw new TaskomaticException(e.getMessage(), e);
}
}
-
+
/**
* Initiates the shutdown process. Needs to happen in a
* separate thread to prevent Quartz scheduler errors.
@@ -156,8 +151,7 @@ public class SchedulerKernel {
*/
protected void shutdown() {
try {
- this.scheduler.standby();
- deleteAllJobs();
+ this.scheduler.standby();
this.scheduler.shutdown();
}
catch (SchedulerException e) {
@@ -165,50 +159,16 @@ public class SchedulerKernel {
e.printStackTrace();
}
finally {
- MessageQueue.stopMessaging();
- HibernateFactory.closeSessionFactory();
+ MessageQueue.stopMessaging();
+ HibernateFactory.closeSessionFactory();
// Wake up thread waiting in startup() so it can exit
synchronized (this.shutdownLock) {
this.shutdownLock.notify();
}
}
}
-
-
- private void scheduleJobs(Map pendingJobs) throws ConfigException {
- // No jobs to schedule
- // This would be quite odd, but it could happen
- if (pendingJobs == null || pendingJobs.size() == 0) {
- log.error("No tasks scheduled");
- throw new ConfigException("No tasks scheduled");
- }
- try {
- for (Iterator iter = pendingJobs.keySet().iterator(); iter.hasNext();) {
- String suffix = (String) iter.next();
- String[] data = (String[]) pendingJobs.get(suffix);
- String jobImpl = data[0];
- String crontab = data[1];
- String jobName = jobImpl + "-" + suffix;
- JobDetail detail = new JobDetail(jobName,
- TaskomaticConstants.TASK_GROUP,
- this.getClass().getClassLoader().loadClass(jobImpl));
- Trigger trigger = null;
- trigger = new CronTrigger(jobImpl,
- TaskomaticConstants.TASK_GROUP, crontab);
- trigger.setMisfireInstruction(CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING);
- trigger.addTriggerListener(this.chainedTriggerListener.getName());
- this.scheduler.scheduleJob(detail, trigger);
- if (log.isDebugEnabled()) {
- log.debug("Scheduled " + detail.getFullName());
- }
- }
- }
- catch (Throwable t) {
- log.error(t.getMessage(), t);
- throw new ConfigException(t.getMessage(), t);
- }
- }
-
+
+
private void deleteAllJobs() {
boolean done = false;
while (!done) {
commit 1b1ef71b217a67dfeec20b28098b5829e534746a
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jul 27 16:14:51 2010 +0200
remove unused classes
diff --git a/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskException.java b/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskException.java
deleted file mode 100644
index f4703de..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic;
-
-
-/**
- * NoSuchTaskException
- * @version $Rev$
- */
-public class NoSuchTaskException extends Exception {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = -1252459283237351146L;
-
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskoTriggerException.java b/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskoTriggerException.java
deleted file mode 100644
index 196a34b..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/NoSuchTaskoTriggerException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic;
-
-
-public class NoSuchTaskoTriggerException extends Exception {
-
- /**
- * Comment for <code>serialVersionUID</code>
- */
- private static final long serialVersionUID = 1110623343705256957L;
-
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/JobFactory.java b/java/code/src/com/redhat/rhn/taskomatic/task/JobFactory.java
deleted file mode 100644
index 091d4f4..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/task/JobFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.task;
-
-import org.quartz.Job;
-
-/**
- * JobFactory
- * @version $Rev$
- */
-public class JobFactory {
-
- private JobFactory() {
- }
-
- /**
- * Creates a Job from a classname
- * @param className fully qualified classname of Job to create
- * @return a Job matching the given classname
- * @throws ClassNotFoundException thrown if class is not found
- * @throws IllegalAccessException thrown if a malformed classname is given
- * @throws InstantiationException thrown if there is a problem creating Job
- */
- public static Job createJob(String className) throws ClassNotFoundException,
- IllegalAccessException, InstantiationException {
- Class c = Thread.currentThread().getContextClassLoader().loadClass(className);
- return (Job) c.newInstance();
- }
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/RhnExtCmdJob.java b/java/code/src/com/redhat/rhn/taskomatic/task/RhnExtCmdJob.java
deleted file mode 100644
index b5a0721..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/task/RhnExtCmdJob.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright (c) 2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.task;
-
-import com.redhat.rhn.manager.satellite.SystemCommandExecutor;
-
-import org.apache.log4j.Logger;
-
-
-/**
- * RhnExtCmdJob
- * @version $Rev$
- */
-public abstract class RhnExtCmdJob implements RhnJob {
-
- private Logger log = null;
- private String stdOutput;
- private String stdError;
-
- public Logger getLogger(Class clazz) {
- if (log == null) {
- log = Logger.getLogger(clazz);
- }
- return log;
- }
-
- protected void executeExtCmd(String[] args) {
- SystemCommandExecutor ce = new SystemCommandExecutor();
- ce.execute(args);
-
- setStdOutput(ce.getLastCommandOutput());
- setStdError(ce.getLastCommandErrorMessage());
- }
-
- private void setStdError(String stdErrorIn) {
- stdError = stdErrorIn;
- }
-
- private void setStdOutput(String stdOutputIn) {
- stdOutput = stdOutputIn;
- }
-
- public String getLogOutput() {
- return stdOutput;
- }
-
- public String getLogError() {
- return stdError;
- }
-
- public void appendExceptionToLogError(Exception e) {
- e.printStackTrace();
- stdError += e.getMessage();
- stdError += e.getCause();
- }
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTask.java
deleted file mode 100644
index 73fb364..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTask.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.task;
-
-import com.redhat.rhn.common.hibernate.HibernateFactory;
-import com.redhat.rhn.taskomatic.core.SchedulerKernel;
-
-import org.apache.log4j.Logger;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-/**
- * Custom Quartz Job implementation which only allows one thread to
- * run at a time. All other threads return without performing any work.
- * This policy was chosen instead of blocking so as to reduce threading
- * problems inside Quartz itself.
- *
- * @version $Rev $
- *
- */
-public abstract class SingleThreadedTask implements Job {
-
- private static boolean isExecuting = false;
-
- /**
- * {@inheritDoc}
- */
- public void execute(JobExecutionContext ctx)
- throws JobExecutionException {
- synchronized (this) {
- if (isExecuting) {
- Logger logger = Logger.getLogger(SchedulerKernel.class);
- logger.info("Instance of " + getClass().getName() + " already running..." +
- "Exiting");
- return;
- }
- else {
- isExecuting = true;
- }
- }
- try {
- run(ctx);
- HibernateFactory.commitTransaction();
- }
- catch (Throwable t) {
- HibernateFactory.rollbackTransaction();
- Logger logger = Logger.getLogger(SchedulerKernel.class);
- logger.error(t);
- TaskHelper.sendErrorMail(logger, t);
- throw new JobExecutionException(t.getMessage());
- }
- finally {
- synchronized (this) {
- isExecuting = false;
- }
- HibernateFactory.closeSession();
- }
- }
-
- protected abstract void run(JobExecutionContext ctx) throws JobExecutionException;
-
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTestableTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTestableTask.java
deleted file mode 100644
index 5e2bf72..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/task/SingleThreadedTestableTask.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.task;
-
-import com.redhat.rhn.common.hibernate.HibernateFactory;
-import com.redhat.rhn.taskomatic.core.SchedulerKernel;
-
-import org.apache.log4j.Logger;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-/**
- * Custom Quartz Job implementation which only allows one thread to
- * run at a time. All other threads return without performing any work.
- * This policy was chosen instead of blocking so as to reduce threading
- * problems inside Quartz itself.
- *
- * @version $Rev $
- *
- */
-public abstract class SingleThreadedTestableTask implements TestableTask {
-
- private boolean isExecuting = false;
-
- /**
- * {@inheritDoc}
- */
- public void execute(JobExecutionContext context)
- throws JobExecutionException {
- synchronized (this) {
- if (this.isExecuting) {
- Logger logger = Logger.getLogger(SchedulerKernel.class);
- logger.info("Instance of " + getClass().getName() + " already running..." +
- "Exiting");
- return;
- }
- else {
- this.isExecuting = true;
- }
- }
- try {
- execute(context, false);
- HibernateFactory.commitTransaction();
- }
- catch (Throwable t) {
- HibernateFactory.rollbackTransaction();
- Logger logger = Logger.getLogger(SchedulerKernel.class);
- logger.error(t);
- TaskHelper.sendErrorMail(logger, t);
- throw new JobExecutionException(t.getMessage());
- }
- finally {
- synchronized (this) {
- this.isExecuting = false;
- }
- HibernateFactory.closeSession();
- }
- }
-}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/TestableTask.java b/java/code/src/com/redhat/rhn/taskomatic/task/TestableTask.java
deleted file mode 100644
index f35e304..0000000
--- a/java/code/src/com/redhat/rhn/taskomatic/task/TestableTask.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
- *
- * This software is licensed to you under the GNU General Public License,
- * version 2 (GPLv2). There is NO WARRANTY for this software, express or
- * implied, including the implied warranties of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
- * along with this software; if not, see
- * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
- *
- * Red Hat trademarks are not licensed under GPLv2. No permission is
- * granted to use or replicate Red Hat trademarks that are incorporated
- * in this software or its documentation.
- */
-package com.redhat.rhn.taskomatic.task;
-
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
-/**
- * Eases unit testing Quartz' jobs
- *
- * @version $Rev $
- */
-public interface TestableTask extends Job {
-
- /**
- * Entry point for all scheduled tasks
- * @param ctx Quartz job runtime environment
- * @param testContext Flags if the task is executing inside of a unit test
- * @throws JobExecutionException Indicates a fatal processing error
- */
- void execute(JobExecutionContext ctx, boolean testContext)
- throws JobExecutionException;
-}
commit c3c579c91b9b1e829d783b5073fd3666ec467279
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jul 27 14:54:47 2010 +0200
remove initial population of rhnDaemonState table
diff --git a/schema/spacewalk/common/data/rhnDaemonState.sql b/schema/spacewalk/common/data/rhnDaemonState.sql
deleted file mode 100644
index ef23553..0000000
--- a/schema/spacewalk/common/data/rhnDaemonState.sql
+++ /dev/null
@@ -1,35 +0,0 @@
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
---
---
---
--- data for the entitlement poll
---
-
--- we don't have a great way to exclude 'entitlement_run_me' on satellite.
--- no big deal though, it just won't get used.
-insert into rhnDaemonState values ('entitlement_run_me',sysdate-1000);
-insert into rhnDaemonState values ('email_engine',sysdate-1000);
-insert into rhnDaemonState values ('payloader_engine',sysdate-1000);
-insert into rhnDaemonState values ('pushed_users',sysdate-1000);
-commit;
-
---
--- Revision 1.2 2003/01/24 16:18:50 pjones
--- fix initial inserts here too
---
--- Revision 1.1 2003/01/13 22:59:03 pjones
--- rhnDaemonState population and grants/synonyms
---
commit 20f3c2041c761d3a95ef380711dc7502af231be7
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jul 27 12:09:35 2010 +0200
checkstyle changes
diff --git a/java/code/src/com/redhat/rhn/taskomatic/TaskoJob.java b/java/code/src/com/redhat/rhn/taskomatic/TaskoJob.java
index 430c6be..bc905e5 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/TaskoJob.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/TaskoJob.java
@@ -48,7 +48,8 @@ public class TaskoJob implements Job {
private boolean isTaskSingleThreaded(TaskoTask task) {
try {
- RhnQueueJob job = (RhnQueueJob) Class.forName(task.getTaskClass()).newInstance();
+ RhnQueueJob job = (RhnQueueJob)
+ Class.forName(task.getTaskClass()).newInstance();
}
catch (Exception e) {
return false;
@@ -111,7 +112,7 @@ public class TaskoJob implements Job {
continue;
}
}
- else{
+ else {
while (!isTaskThreadAvailable(task)) {
try {
log.debug(schedule.getJobLabel() + ":" + " task " +
@@ -153,8 +154,8 @@ public class TaskoJob implements Job {
TaskoFactory.rollbackTransaction();
}
- log.debug(task.getName() +
- " (" + schedule.getJobLabel() + ") ... " + taskRun.getStatus().toLowerCase());
+ log.debug(task.getName() + " (" + schedule.getJobLabel() + ") ... " +
+ taskRun.getStatus().toLowerCase());
previousRun = taskRun;
synchronized (lock) {
unmarkTaskRunning(task);
diff --git a/java/code/src/com/redhat/rhn/taskomatic/TaskoRun.java b/java/code/src/com/redhat/rhn/taskomatic/TaskoRun.java
index a4bbaf8..39d5613 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/TaskoRun.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/TaskoRun.java
@@ -161,8 +161,8 @@ public class TaskoRun {
}
private boolean logPresent(String fileName) {
- File log = new File(fileName);
- return log.length() > 0;
+ File logFile = new File(fileName);
+ return logFile.length() > 0;
}
private void appendLogToFile(String fileName, String logContent) {
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/ChannelRepodata.java b/java/code/src/com/redhat/rhn/taskomatic/task/ChannelRepodata.java
index 3150a53..586cc67 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/ChannelRepodata.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/ChannelRepodata.java
@@ -26,7 +26,7 @@ import org.apache.log4j.Logger;
public class ChannelRepodata extends RhnQueueJob {
public static final String DISPLAY_NAME = "channel_repodata";
- public static Logger log = null;
+ private static Logger log = null;
protected Logger getLogger() {
if (log == null) {
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/ErrataMailer.java b/java/code/src/com/redhat/rhn/taskomatic/task/ErrataMailer.java
index 67f005b..aa6c31d 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/ErrataMailer.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/ErrataMailer.java
@@ -164,7 +164,6 @@ public class ErrataMailer extends RhnJavaJob {
int rowsUpdated = marker.executeUpdate(params);
if (log.isDebugEnabled()) {
log.debug("Marked " + rowsUpdated + " rows complete");
- log.debug("errata_id = " + errataId + " AND channel_id = " + channelId + " AND org_id = " + orgId);
}
tx.commit();
}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/ErrataQueue.java b/java/code/src/com/redhat/rhn/taskomatic/task/ErrataQueue.java
index 78fbed9..b3b4b87 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/ErrataQueue.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/ErrataQueue.java
@@ -29,7 +29,7 @@ public class ErrataQueue extends RhnQueueJob {
* Used to log stats in the RHNDAEMONSTATE table
*/
public static final String DISPLAY_NAME = "errata_queue";
- public static Logger log = null;
+ private static Logger log = null;
@Override
protected Logger getLogger() {
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/KickstartCleanup.java b/java/code/src/com/redhat/rhn/taskomatic/task/KickstartCleanup.java
index 9f721bd..78d1553 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/KickstartCleanup.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/KickstartCleanup.java
@@ -44,7 +44,6 @@ public class KickstartCleanup extends RhnJavaJob {
/**
* Primarily a convenience method to make testing easier
* @param ctx Quartz job runtime environment
- * @param testMode Enables task results validation
*
* @throws JobExecutionException Indicates somes sort of fatal error
*/
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/RhnJob.java b/java/code/src/com/redhat/rhn/taskomatic/task/RhnJob.java
index 1a1b321..856f89e 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/RhnJob.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/RhnJob.java
@@ -23,7 +23,7 @@ import org.quartz.JobExecutionException;
public abstract interface RhnJob extends Job {
- final public String DEFAULT_LOGGING_LAYOUT = "%d [%t] %-5p %c %x - %m%n";
+ String DEFAULT_LOGGING_LAYOUT = "%d [%t] %-5p %c %x - %m%n";
void execute(JobExecutionContext context, TaskoRun taskRun)
throws JobExecutionException;
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/RhnQueueJob.java b/java/code/src/com/redhat/rhn/taskomatic/task/RhnQueueJob.java
index 2d27e6a..87ae6f4 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/RhnQueueJob.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/RhnQueueJob.java
@@ -40,9 +40,9 @@ import java.io.IOException;
public abstract class RhnQueueJob implements RhnJob {
private TaskoRun jobRun = null;
- boolean queueEmpty = true;
+ private boolean queueEmpty = true;
- abstract protected Logger getLogger();
+ protected abstract Logger getLogger();
public void appendExceptionToLogError(Exception e) {
getLogger().error(e.getMessage());
@@ -54,7 +54,8 @@ public abstract class RhnQueueJob implements RhnJob {
new PatternLayout(DEFAULT_LOGGING_LAYOUT);
try {
getLogger().removeAllAppenders();
- FileAppender appender = new FileAppender(pattern, jobRun.buildStdOutputLogPath());
+ FileAppender appender = new FileAppender(pattern,
+ jobRun.buildStdOutputLogPath());
getLogger().addAppender(appender);
}
catch (IOException e) {
@@ -71,7 +72,8 @@ public abstract class RhnQueueJob implements RhnJob {
setJobRun(runIn);
try {
execute(ctx);
- } catch (Exception e) {
+ }
+ catch (Exception e) {
if (HibernateFactory.getSession().getTransaction().isActive()) {
HibernateFactory.rollbackTransaction();
}
@@ -101,9 +103,10 @@ public abstract class RhnQueueJob implements RhnJob {
if (queue.changeRun(jobRun)) {
jobRun.start();
logToNewFile();
- getLogger().debug("Starting run "+ jobRun.getId());
+ getLogger().debug("Starting run " + jobRun.getId());
}
- int maxWorkItems = Config.get().getInt("taskomatic." + queueName + "_max_work_items", 3);
+ int maxWorkItems = Config.get().getInt("taskomatic." + queueName +
+ "_max_work_items", 3);
if (queue.getQueueSize() < maxWorkItems) {
queue.run(this);
}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/ChannelRepodataDriver.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/ChannelRepodataDriver.java
index 69cfa8d..4beb145 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/ChannelRepodataDriver.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/ChannelRepodataDriver.java
@@ -44,7 +44,7 @@ public class ChannelRepodataDriver implements QueueDriver {
* {@inheritDoc}
*/
public void initialize() {
- logger.info("ChannelRepodataDriver()--resetting orphanned rhnRepoRegenQueue entries");
+ logger.info("resetting orphanned rhnRepoRegenQueue entries");
WriteMode resetChannelRepodata = ModeFactory.getWriteMode(TaskConstants.MODE_NAME,
TaskConstants.TASK_QUERY_REPOMOD_CLEAR_IN_PROGRESS);
try {
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/QueueDriver.java b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/QueueDriver.java
index 38ac5d1..b6897c0 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/QueueDriver.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/QueueDriver.java
@@ -26,7 +26,7 @@ public interface QueueDriver {
/**
* Set the logger to use for all logging operations
- * @return void
+ * @param loggerIn logger to be set
*/
void setLogger(Logger loggerIn);
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueue.java b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueue.java
index 50a6f89..8e9f9c1 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueue.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueue.java
@@ -138,7 +138,7 @@ public class TaskQueue {
}
if (isTaskQueueDone()) {
// everything done
- queueDriver.getLogger().debug("Finishing run "+ queueRun.getId());
+ queueDriver.getLogger().debug("Finishing run " + queueRun.getId());
queueRun.finished();
queueRun.saveStatus(TaskoRun.STATUS_FINISHED);
TaskoFactory.commitTransaction();
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueueFactory.java b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueueFactory.java
index e1e0fd6..cb754be 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueueFactory.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/threaded/TaskQueueFactory.java
@@ -64,7 +64,8 @@ public class TaskQueueFactory {
* @return queue instance
* @throws Exception error occurred during queue creation
*/
- public TaskQueue createQueue(String name, Class driverClass, Logger loggerIn) throws Exception {
+ public TaskQueue createQueue(String name, Class driverClass, Logger loggerIn)
+ throws Exception {
TaskQueue retval = null;
synchronized (queues) {
retval = (TaskQueue) queues.get(name);
13 years, 9 months
Changes to 'refs/tags/spacewalk-java-1.1.42-1'
by Milan Zazrivec
Tag 'spacewalk-java-1.1.42-1' created by Milan Zazrivec <mzazrivec(a)redhat.com> at 2010-08-02 09:59 +0000
Tagging package [spacewalk-java] version [1.1.42-1] in directory [java/].
Changes since spacewalk-java-1.1.41-1:
Milan Zazrivec (2):
point taskomatic to slf4j jars
Automatic commit of package [spacewalk-java] release [1.1.42-1].
---
java/conf/default/rhn_taskomatic_daemon.conf | 2 ++
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
---
13 years, 9 months