2 commits - java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java | 2
java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java | 24 +++++++++-
java/code/src/com/redhat/rhn/taskomatic/TaskoXmlRpcHandler.java | 13 +++--
3 files changed, 33 insertions(+), 6 deletions(-)
New commits:
commit f29df423659b008f974a6a25f899218d6f0abfd4
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Nov 26 15:02:34 2010 +0100
658167 - fix cases, when quartz triggers a job earlier, than the job info lands in the DB
diff --git a/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java b/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
index cebb115..899d105 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
@@ -65,7 +65,7 @@ public class TaskoQuartzHelper {
public static Date createJob(TaskoSchedule schedule) throws InvalidParamException {
// create trigger
Trigger trigger = null;
- if ((schedule.getCronExpr() == null) || (schedule.getCronExpr().isEmpty())) {
+ if (isCronExpressionEmpty(schedule.getCronExpr())) {
trigger = new SimpleTrigger(schedule.getJobLabel(),
getGroupName(schedule.getOrgId()), 1, 1);
trigger.setEndTime(new Date());
@@ -134,4 +134,26 @@ public class TaskoQuartzHelper {
}
return orgId.toString();
}
+
+ private static boolean isCronExpressionEmpty(String cronExpr) {
+ return (cronExpr == null || cronExpr.isEmpty());
+ }
+
+ /**
+ * returns, whether cron expression is valid
+ * @param cronExpression cron expression
+ * @return true, if expression is valid
+ */
+ public static boolean isValidCronExpression(String cronExpression) {
+ if (isCronExpressionEmpty(cronExpression)) {
+ return true;
+ }
+ try {
+ new CronTrigger().setCronExpression(cronExpression);
+ }
+ catch (Exception e) {
+ return false;
+ }
+ return true;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/taskomatic/TaskoXmlRpcHandler.java b/java/code/src/com/redhat/rhn/taskomatic/TaskoXmlRpcHandler.java
index 200a2dd..d9419aa 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/TaskoXmlRpcHandler.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/TaskoXmlRpcHandler.java
@@ -81,15 +81,19 @@ public class TaskoXmlRpcHandler {
catch (SchedulerException se) {
return null;
}
+ if (!TaskoQuartzHelper.isValidCronExpression(cronExpression)) {
+ throw new InvalidParamException("Cron trigger: " + cronExpression);
+ }
// create schedule
- TaskoSchedule schedule = null;
- schedule = new TaskoSchedule(orgId, bunch, jobLabel, params,
+ TaskoSchedule schedule = new TaskoSchedule(orgId, bunch, jobLabel, params,
startTime, endTime, cronExpression);
TaskoFactory.save(schedule);
+ TaskoFactory.commitTransaction();
// create job
Date scheduleDate = TaskoQuartzHelper.createJob(schedule);
if (scheduleDate == null) {
TaskoFactory.delete(schedule);
+ TaskoFactory.commitTransaction();
}
return scheduleDate;
}
@@ -234,14 +238,15 @@ public class TaskoXmlRpcHandler {
return null;
}
// create schedule
- TaskoSchedule schedule = null;
- schedule = new TaskoSchedule(orgId, bunch, jobLabel, params,
+ TaskoSchedule schedule = new TaskoSchedule(orgId, bunch, jobLabel, params,
start, null, null);
TaskoFactory.save(schedule);
+ TaskoFactory.commitTransaction();
// create job
Date scheduleDate = TaskoQuartzHelper.createJob(schedule);
if (scheduleDate == null) {
TaskoFactory.delete(schedule);
+ TaskoFactory.commitTransaction();
}
return scheduleDate;
}
commit b6681ce923453eff797dfc5a292ee446b783d3fc
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Nov 29 13:23:07 2010 +0100
516570 - just unify channel dates format
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
index 355ce29..223da37 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java
@@ -587,7 +587,7 @@ public class EditChannelAction extends RhnAction implements Listable {
String lastSync = LocalizationService.getInstance().getMessage(
"channel.edit.repo.neversynced");
if (c.getLastSynced() != null) {
- lastSync = LocalizationService.getInstance().formatDate(
+ lastSync = LocalizationService.getInstance().formatCustomDate(
c.getLastSynced());
}
request.setAttribute("last_sync", lastSync);
13 years, 5 months
Changes to 'refs/tags/spacewalk-proxy-1.3.3-1'
by Miroslav Suchý
Tag 'spacewalk-proxy-1.3.3-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-11-29 13:07 +0000
Tagging package [spacewalk-proxy] version [1.3.3-1] in directory [proxy/proxy/].
Changes since spacewalk-backend-1.3.15-1:
Miroslav Suchý (2):
657956 - fix condrestart option
Automatic commit of package [spacewalk-proxy] release [1.3.3-1].
---
proxy/proxy/rhn-proxy | 8 ++++++--
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
3 files changed, 11 insertions(+), 4 deletions(-)
---
13 years, 5 months
proxy/proxy rel-eng/packages
by Miroslav Suchý
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 1a7150abb21830094406d7dbbf1ab260840d8fc5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Nov 29 14:07:49 2010 +0100
Automatic commit of package [spacewalk-proxy] release [1.3.3-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index 877fa9e..7a1d4fb 100644
--- a/proxy/proxy/spacewalk-proxy.spec
+++ b/proxy/proxy/spacewalk-proxy.spec
@@ -4,7 +4,7 @@ Group: Applications/Internet
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.3.2
+Version: 1.3.3
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
@@ -332,6 +332,9 @@ fi
%changelog
+* Mon Nov 29 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.3.3-1
+- 657956 - fix condrestart option (msuchy(a)redhat.com)
+
* Wed Nov 24 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.3.2-1
- removed unused imports
diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy
index 5826ee0..c0faec8 100644
--- a/rel-eng/packages/spacewalk-proxy
+++ b/rel-eng/packages/spacewalk-proxy
@@ -1 +1 @@
-1.3.2-1 proxy/proxy/
+1.3.3-1 proxy/proxy/
13 years, 5 months
proxy/proxy
by Miroslav Suchý
proxy/proxy/rhn-proxy | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit bfd2dd3955b67b7deb91f0b0f37dad1cc0359bf2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Nov 29 14:03:55 2010 +0100
657956 - fix condrestart option
diff --git a/proxy/proxy/rhn-proxy b/proxy/proxy/rhn-proxy
index 68e6d7b..355baa5 100755
--- a/proxy/proxy/rhn-proxy
+++ b/proxy/proxy/rhn-proxy
@@ -72,8 +72,12 @@ case "$1" in
restart
;;
condrestart)
- wrd_services condrestart
- ;;
+ if [ -f /var/lock/subsys/rhn-proxy ]; then
+ stop
+ start
+ RETVAL=$?
+ fi
+ ;;
*)
echo "Usage: rhn-proxy {start|stop|status|restart|condrestart}"
exit 1
13 years, 5 months
Changes to 'refs/tags/spacewalk-backend-1.3.15-1'
by Michael Mraka
Tag 'spacewalk-backend-1.3.15-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-11-29 12:13 +0000
Tagging package [spacewalk-backend] version [1.3.15-1] in directory [backend/].
Changes since spacewalk-web-1.3.7-1:
Michael Mraka (8):
run backend unit test in rpm build time
look for python modules in buildroot
fixed rhnCache.CACHEDIR in unit tests
fixed rfc822time unit tests
test_tsort.py is no longer with us
fixed test_capabilities
moved tests which require db to DB_TESTS
Automatic commit of package [spacewalk-backend] release [1.3.15-1].
---
backend/Makefile.backend | 4 ++--
backend/common/test/unit-test/Makefile | 5 ++---
backend/common/test/unit-test/test_rhnCache.py | 1 +
backend/common/test/unit-test/test_rhnLib.py | 7 +++++--
backend/server/test/unit-test/Makefile | 9 +++++++--
backend/server/test/unit-test/test_capabilities.py | 8 +++++++-
backend/spacewalk-backend.spec | 9 ++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
8 files changed, 33 insertions(+), 12 deletions(-)
---
13 years, 5 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b6026adaa92927b801dc07ee91bc40eaeceb4a17
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 13:13:44 2010 +0100
Automatic commit of package [spacewalk-backend] release [1.3.15-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 05483d4..6aaeec3 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -11,7 +11,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2 and Python
-Version: 1.3.14
+Version: 1.3.15
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -672,6 +672,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Nov 29 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.3.15-1
+- fixed unit tests
+- run backend unit test in rpm build time
+
* Thu Nov 25 2010 Lukas Zapletal 1.3.14-1
- Fixing missing method parameter in rhn_config_management
- fixed typo
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 7cd8c62..b905dc6 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.14-1 backend/
+1.3.15-1 backend/
13 years, 5 months
7 commits - backend/common backend/Makefile.backend backend/server backend/spacewalk-backend.spec
by Michael Mraka
backend/Makefile.backend | 4 ++--
backend/common/test/unit-test/Makefile | 5 ++---
backend/common/test/unit-test/test_rhnCache.py | 1 +
backend/common/test/unit-test/test_rhnLib.py | 7 +++++--
backend/server/test/unit-test/Makefile | 9 +++++++--
backend/server/test/unit-test/test_capabilities.py | 8 +++++++-
backend/spacewalk-backend.spec | 3 +++
7 files changed, 27 insertions(+), 10 deletions(-)
New commits:
commit e2179ac40e903f2cdccde8c29435202f603cff88
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 13:03:25 2010 +0100
moved tests which require db to DB_TESTS
and let run only (non-db) TESTS in rpmbuild
diff --git a/backend/server/test/unit-test/Makefile b/backend/server/test/unit-test/Makefile
index 97701ae..60e7a18 100644
--- a/backend/server/test/unit-test/Makefile
+++ b/backend/server/test/unit-test/Makefile
@@ -1,12 +1,16 @@
-TESTS = \
+DB_TESTS = \
test_capabilities.py \
test_misc_functions.py \
test_rhnActivationKey.py \
test_rhnChannel.py \
+ test_rhnDatabaseCache.py \
test_rhnServerGroup.py \
test_server_registration.py
+TESTS = \
+ test_rhnLib_timestamp.py
+
all: $(addprefix test-,$(TESTS))
test-%:
commit 51bdb504a41ce76a54d45dcd99a8f80f87cea6ed
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 12:05:20 2010 +0100
fixed test_capabilities
diff --git a/backend/server/test/unit-test/test_capabilities.py b/backend/server/test/unit-test/test_capabilities.py
index 2c13456..02ab8eb 100644
--- a/backend/server/test/unit-test/test_capabilities.py
+++ b/backend/server/test/unit-test/test_capabilities.py
@@ -31,6 +31,7 @@ if _basedir not in sys.path:
import time
from rhn import rpclib
from spacewalk.server import rhnSQL, rhnServer, rhnCapability
+from spacewalk.common.rhnConfig import ConfigParserError
def main():
if len(sys.argv) == 1:
@@ -43,7 +44,12 @@ def main():
else:
db_name = sys.argv[2]
- rhnSQL.initDB(db_name)
+ try:
+ rhnSQL.initDB(db_name)
+ except ConfigParserError:
+ # database is not available when running in rpmbuild time
+ print "Test skipped"
+ return 0
uri = "http://%s/XMLRPC" % (server_name, )
s = rpclib.Server(uri)
commit b2e8356ff7bd2086479eb268070434bb0ddd729b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 11:01:29 2010 +0100
test_tsort.py is no longer with us
diff --git a/backend/common/test/unit-test/Makefile b/backend/common/test/unit-test/Makefile
index ae398c9..5241126 100644
--- a/backend/common/test/unit-test/Makefile
+++ b/backend/common/test/unit-test/Makefile
@@ -1,8 +1,7 @@
TESTS = \
test_gettext.py \
test_rhnCache.py \
- test_rhnLib.py \
- test_tsort.py
+ test_rhnLib.py
all: $(addprefix test-,$(TESTS))
commit 8d0986426aa8a985376e9b6f36d40fe6ffdb850f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 10:45:18 2010 +0100
fixed rfc822time unit tests
diff --git a/backend/common/test/unit-test/test_rhnLib.py b/backend/common/test/unit-test/test_rhnLib.py
index 58ba015..aed9a2a 100644
--- a/backend/common/test/unit-test/test_rhnLib.py
+++ b/backend/common/test/unit-test/test_rhnLib.py
@@ -19,8 +19,11 @@
import sys
import locale
import unittest
+import time
from spacewalk.common import rhnLib
+TIMEZONE_SHIFT = time.timezone / 3600
+
class Tests(unittest.TestCase):
###########################################################################
@@ -29,14 +32,14 @@ class Tests(unittest.TestCase):
def test_rfc822time_normal_tuple_arg(self):
"rfc822time: Simple call using a valid tuple argument."
- test_arg = (2006, 1, 27, 9, 12, 5, 4, 27, -1)
+ test_arg = (2006, 1, 27, (14 - TIMEZONE_SHIFT), 12, 5, 4, 27, -1)
target = "Fri, 27 Jan 2006 14:12:05 GMT"
result = rhnLib.rfc822time(test_arg)
self.assertEqual(result, target, result + " != " + target)
def test_rfc822time_normal_list_arg(self):
"rfc822time: Simple call using a valid list argument."
- test_arg = [2006, 1, 27, 9, 12, 5, 4, 27, -1]
+ test_arg = [2006, 1, 27, (14 - TIMEZONE_SHIFT), 12, 5, 4, 27, -1]
target = "Fri, 27 Jan 2006 14:12:05 GMT"
result = rhnLib.rfc822time(test_arg)
self.assertEqual(result, target, result + " != " + target)
commit c782639d17ed22a6f080b9a18f1c1a3af4c3680b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 10:21:10 2010 +0100
fixed rhnCache.CACHEDIR in unit tests
diff --git a/backend/common/test/unit-test/test_rhnCache.py b/backend/common/test/unit-test/test_rhnCache.py
index 0f27c6f..fe7d38b 100644
--- a/backend/common/test/unit-test/test_rhnCache.py
+++ b/backend/common/test/unit-test/test_rhnCache.py
@@ -49,6 +49,7 @@ class Tests(unittest.TestCase):
def _test(self, key, content, **modifiers):
# Blow it away
+ rhnCache.CACHEDIR = '/tmp/rhn'
self._cleanup(key)
apply(rhnCache.set, (key, content), modifiers)
self.failUnless(rhnCache.has_key(key))
commit a7b784b118f94080894e07f324fe13e17fc42b38
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 11:32:56 2010 +0100
look for python modules in buildroot
diff --git a/backend/Makefile.backend b/backend/Makefile.backend
index e2393fa..912527f 100644
--- a/backend/Makefile.backend
+++ b/backend/Makefile.backend
@@ -25,5 +25,5 @@ install :: install-code install-conf
clean :: clean-code clean-conf
test ::
- $(MAKE) -C common/test/unit-test
- $(MAKE) -C server/test/unit-test
+ $(MAKE) -C common/test/unit-test PYTHONPATH=$(PYTHONPATH)
+ $(MAKE) -C server/test/unit-test PYTHONPATH=$(PYTHONPATH)
diff --git a/backend/common/test/unit-test/Makefile b/backend/common/test/unit-test/Makefile
index 8b0d180..ae398c9 100644
--- a/backend/common/test/unit-test/Makefile
+++ b/backend/common/test/unit-test/Makefile
@@ -8,4 +8,4 @@ all: $(addprefix test-,$(TESTS))
test-%:
@echo Running $*
- @PYTHONPATH=../../.. python $*
+ @PYTHONPATH=$(PYTHONPATH):../../.. python $*
diff --git a/backend/server/test/unit-test/Makefile b/backend/server/test/unit-test/Makefile
index c7b4764..97701ae 100644
--- a/backend/server/test/unit-test/Makefile
+++ b/backend/server/test/unit-test/Makefile
@@ -1,3 +1,4 @@
+
TESTS = \
test_capabilities.py \
test_misc_functions.py \
@@ -10,4 +11,4 @@ all: $(addprefix test-,$(TESTS))
test-%:
@echo Running $*
- @PYTHONPATH=../../.. python $*
+ PYTHONPATH=$(PYTHONPATH):../../../ python $*
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index f4f3739..05483d4 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -295,7 +295,7 @@ rm -v $RPM_BUILD_ROOT/%{apacheconfd}/zz-spacewalk-server-python.conf
rm -rf $RPM_BUILD_ROOT
%check
-make -f Makefile.backend test
+make -f Makefile.backend PYTHONPATH=$RPM_BUILD_ROOT/%{python_sitelib} test
%pre server
OLD_SECRET_FILE=%{_var}/www/rhns/server/secret/rhnSecret.py
commit 51c5a18c3079a9dda872529c3d45c4ec63cb4940
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Nov 29 09:47:15 2010 +0100
run backend unit test in rpm build time
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 03da5cf..f4f3739 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -294,6 +294,9 @@ rm -v $RPM_BUILD_ROOT/%{apacheconfd}/zz-spacewalk-server-python.conf
%clean
rm -rf $RPM_BUILD_ROOT
+%check
+make -f Makefile.backend test
+
%pre server
OLD_SECRET_FILE=%{_var}/www/rhns/server/secret/rhnSecret.py
if [ -f $OLD_SECRET_FILE ]; then
13 years, 5 months
Changes to 'refs/tags/spacewalk-web-1.3.7-1'
by Michael Mraka
Tag 'spacewalk-web-1.3.7-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-11-27 12:32 +0000
Tagging package [spacewalk-web] version [1.3.7-1] in directory [web/].
Changes since spacewalk-web-1.3.6-1:
Michael Mraka (2):
649706 - execute all recomendations from segment advisor
Automatic commit of package [spacewalk-web] release [1.3.7-1].
---
rel-eng/packages/spacewalk-web | 2 +-
web/modules/dobby/Dobby/DB.pm | 16 ++++------------
web/spacewalk-web.spec | 5 ++++-
3 files changed, 9 insertions(+), 14 deletions(-)
---
13 years, 5 months
rel-eng/packages web/spacewalk-web.spec
by Michael Mraka
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit bd4654174e7594b0213a3b16fe0c6d273d4829fe
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Sat Nov 27 13:32:45 2010 +0100
Automatic commit of package [spacewalk-web] release [1.3.7-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index 89b3ff3..93e8456 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-1.3.6-1 web/
+1.3.7-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 2d3cf89..75c317f 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -2,7 +2,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.3.6
+Version: 1.3.7
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -256,6 +256,9 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Sat Nov 27 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.3.7-1
+- 649706 - execute all recomendations from segment advisor
+
* Fri Nov 26 2010 Jan Pazdziora 1.3.6-1
- Fix handling of eval (DBD::Oracle).
- 642285 - introducing disabled TaskStatus page (tlestach(a)redhat.com)
13 years, 5 months
web/modules
by Michael Mraka
web/modules/dobby/Dobby/DB.pm | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
New commits:
commit b77e7e61560fd74db600c879a59ca8c2928275a8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Sat Nov 27 13:26:18 2010 +0100
649706 - execute all recomendations from segment advisor
incl. enable row movement if necessary
diff --git a/web/modules/dobby/Dobby/DB.pm b/web/modules/dobby/Dobby/DB.pm
index 06fbb87..fed67fe 100644
--- a/web/modules/dobby/Dobby/DB.pm
+++ b/web/modules/dobby/Dobby/DB.pm
@@ -210,19 +210,11 @@ sub shrink_segment {
my $query;
- if ($seg->{SEGMENT_TYPE} eq 'TABLE') {
- $query = sprintf("alter table %s.%s shrink space",
- @$seg{qw/SEGMENT_OWNER SEGMENT_NAME/});
- } elsif ($seg->{SEGMENT_TYPE} eq 'INDEX') {
- $query = sprintf("alter index %s.%s shrink space",
- @$seg{qw/SEGMENT_OWNER SEGMENT_NAME/});
- } else {
- printf "ERROR: do not know how to shrink %s %s.%s\n",
- @$seg{qw/SEGMENT_TYPE SEGMENT_OWNER SEGMENT_NAME/};
- return -1;
- }
my $dbh = $self->connect;
- $dbh->do($query);
+ for $rec ('C3', 'C2', 'C1') {
+ next if not defined($seg->{$rec});
+ $dbh->do($seg->{$rec});
+ }
}
sub listener_startup {
13 years, 5 months