Re: [Spacewalk-devel] [PATCH] Kickstart profiles error handling

2012-11-12 Thread Tomas Lestach
 Yes, my cobbler log contains some helpful info, but how to bring this
 excerpt to the UI if we are only reacting to a download that failed? I
 didn't dig deep into it, I just wanted to hide the html source of the 500
 error page. But I agree it would be much better to present such details to
 the user.

I patched our cobbler, because in cause of a cheetah error it returned 
different output for rhel5(mod_python) and rhel6(mod_wsgi). Now, we shall get 
500 with the error in the response body in both cases.

On WebUI for these cases - I removed the 'Download Kickstart File' link, 
displayed an error message and changed the error backgrond to make sure the 
user notices the problem.

Let me know if you still would like to make some changes.

 
 Excerpt from cobbler.log:
 
 ...
 Here is the corresponding Cheetah code.
 ** I had to guess the line  column numbers, so they are probably incorrect:
 
 Line 47, column 8
 
 Line|Cheetah Code
 |-
 44  |
 45  |mkdir -p /tmp/rhn
 46  |
 47  |drives=$(list-harddrives | awk '{print $1}')
 ^
 48  |for disk in $drives; do
 49  |DISKS=$DISKS $(fdisk -l /dev/$disk | grep -v swap\|LVM\|Extended
 | awk '/^\/dev/{print $1}')
 50  |done
 ...
 
 BTW: This error occurred with a kickstart file that was generated using the
 wizard and pasted into the new profile form afterwards. The cheetah seems
 to complain about the $ signs in the bash code and wants me to escape them.
 Actually I would expect this to work, or not? Not so sure how the cheetah
 will distinguish between bash $ signs and kickstart variables?

Right, this is the behavior I know since my first tries with Spacewalk 
kickstart profiles. I mean it's because of the templating feature.
You either have to escape the dollar signs or have to put the dollar 
containing code into the #raw..#end block.

 
 Thanks,
 Johannes

Related commits:
 747754ef
 74aa5047
 d1789a9e

Regards,
-- 
Tomas Lestach
RHN Satellite Engineering

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] Quartz SimpleTrigger mis-fire situations

2012-11-12 Thread Johannes Renner
Hello,

When scheduling many repo syncs at a time (as 'mgr-ncc-sync' does it), we 
experienced
that not all of the channels were actually getting a refresh, try it with e.g. 
~ 30.
After some research we found that this is due to the 'repeat count' parameter 
given to
the SimpleTrigger constructor in TaskoQuartzHelper. This parameter seems to 
control the
so-called 'mis-fire' behavior in case there is e.g. no threads available at the 
actual
schedule time. There is usually not many threads available in this use case, 
since repo
sync tasks trigger the generation of new repository metadata as well.

Please see [1] or [2] for more details about handling of mis-fire situations in 
quartz.
The proposal is to use default values for repeat count and repeat interval, 
which will
lead to a more reasonable behavior (MISFIRE_INSTRUCTION_FIRE_NOW).

See the attached patch for a fix.

Regards,
Johannes

[1]
http://quartz-scheduler.org/api/1.8.5/org/quartz/SimpleTrigger.html#updateAfterMisfire%28org.quartz.Calendar%29
[2] http://java.dzone.com/articles/quartz-scheduler-misfire

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
From e6172072966a2a7824770a48a033b064c787ac8b Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Fri, 9 Nov 2012 11:22:50 +0100
Subject: [PATCH] Fix quartz trigger initialization repeat count

---
 java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java b/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
index 191a5a9..864a7b8 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/TaskoQuartzHelper.java
@@ -67,7 +67,7 @@ public class TaskoQuartzHelper {
 Trigger trigger = null;
 if (isCronExpressionEmpty(schedule.getCronExpr())) {
 trigger = new SimpleTrigger(schedule.getJobLabel(),
-getGroupName(schedule.getOrgId()), 1, 1);
+getGroupName(schedule.getOrgId()));
 }
 else {
 try {
-- 
1.7.10.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] Kickstart profiles error handling

2012-11-12 Thread Johannes Renner
On 11/12/2012 01:31 PM, Tomas Lestach wrote:
 Yes, my cobbler log contains some helpful info, but how to bring this
 excerpt to the UI if we are only reacting to a download that failed? I
 didn't dig deep into it, I just wanted to hide the html source of the 500
 error page. But I agree it would be much better to present such details to
 the user.
 
 I patched our cobbler, because in cause of a cheetah error it returned 
 different output for rhel5(mod_python) and rhel6(mod_wsgi). Now, we shall get 
 500 with the error in the response body in both cases.
 
 On WebUI for these cases - I removed the 'Download Kickstart File' link, 
 displayed an error message and changed the error backgrond to make sure the 
 user notices the problem.
 
 Let me know if you still would like to make some changes.
 

 Excerpt from cobbler.log:

 ...
 Here is the corresponding Cheetah code.
 ** I had to guess the line  column numbers, so they are probably incorrect:

 Line 47, column 8

 Line|Cheetah Code
 |-
 44  |
 45  |mkdir -p /tmp/rhn
 46  |
 47  |drives=$(list-harddrives | awk '{print $1}')
 ^
 48  |for disk in $drives; do
 49  |DISKS=$DISKS $(fdisk -l /dev/$disk | grep -v swap\|LVM\|Extended
 | awk '/^\/dev/{print $1}')
 50  |done
 ...

 BTW: This error occurred with a kickstart file that was generated using the
 wizard and pasted into the new profile form afterwards. The cheetah seems
 to complain about the $ signs in the bash code and wants me to escape them.
 Actually I would expect this to work, or not? Not so sure how the cheetah
 will distinguish between bash $ signs and kickstart variables?
 
 Right, this is the behavior I know since my first tries with Spacewalk 
 kickstart profiles. I mean it's because of the templating feature.
 You either have to escape the dollar signs or have to put the dollar 
 containing code into the #raw..#end block.
 

 Thanks,
 Johannes
 
 Related commits:
  747754ef
  74aa5047
  d1789a9e

Thank you, I merged your commits into our branch, but did not do any testing 
yet.
Two remarks regarding d1789a9e:

- I fixed a typo in one of the new messages: bellow - below
- I think we could omit the ';' after the '}' of the newly inserted css

A patch is attached.

Regards,
Johannes

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
From 2062558127111d5fec6d1d2313d6d67e9b4208e0 Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Mon, 12 Nov 2012 16:45:09 +0100
Subject: [PATCH] Fix typos

---
 branding/css/blue-docs.css   |2 +-
 .../src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/branding/css/blue-docs.css b/branding/css/blue-docs.css
index 1bec875..40909b2 100644
--- a/branding/css/blue-docs.css
+++ b/branding/css/blue-docs.css
@@ -139,7 +139,7 @@ pre,code,.guibutton,.keycap,.guilabel{font-size:0.9em;font-family:liberation mo
 .command .replaceable{color:#555;}
 pre{display:block;background-color:#f7f2d0;color:#333;overflow:auto;}
 pre code, code{white-space:normal;}
-pre.warning { padding: 1em; background-color: #d7d7d7; };
+pre.warning { padding: 1em; background-color: #d7d7d7; }
 
 /*Notifications*/
 div.note,div.tip ,div.important ,div.caution ,div.warning{
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index cb8b0a8..2e558d6 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -8242,7 +8242,7 @@ Please note that some manual configuration of these scripts may still be require
 /context-group
   /trans-unit
   trans-unit id=kickstart.jsp.error.template_message
-sourceThere are errors in your kickstart template. Please check the error message bellow./source
+sourceThere are errors in your kickstart template. Please check the error message below./source
 context-group name=ctx
   context context-type=sourcefileKickstart Details/context
 /context-group
-- 
1.7.10.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] Kickstart profiles error handling

2012-11-12 Thread Tomas Lestach
 Thank you, I merged your commits into our branch, but did not do any testing
 yet. Two remarks regarding d1789a9e:
 
 - I fixed a typo in one of the new messages: bellow - below
 - I think we could omit the ';' after the '}' of the newly inserted css
 
 A patch is attached.

Applied as: dfaa9e58b2740debe1d3557bd073f137b4862623

 
 Regards,
 Johannes

Thanks!
-- 
Tomas Lestach
RHN Satellite Engineering

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel