4 commits - backend/common backend/satellite_tools
by Miroslav Suchý
backend/common/rhnMail.py | 10 +++--
backend/satellite_tools/messages.py | 68 +++++++++++++++++++-----------------
backend/satellite_tools/satsync.py | 43 +++++++++++++++++++++-
3 files changed, 85 insertions(+), 36 deletions(-)
New commits:
commit 88a9273544879bb86db5cea5dc4288cb2c41bb08
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 11:47:15 2011 +0200
683200 - send emails as utf-8
diff --git a/backend/common/rhnMail.py b/backend/common/rhnMail.py
index f7aaa60..b96e2b9 100644
--- a/backend/common/rhnMail.py
+++ b/backend/common/rhnMail.py
@@ -22,6 +22,7 @@ import smtplib
from rhnConfig import CFG
from rhnLog import log_error
+from rhn.connections import idn_pune_to_unicode
# check if the headers have the minimum required fields
def __check_headers(h):
@@ -29,11 +30,13 @@ def __check_headers(h):
# does not look like a dictionary
h = {}
if not h.has_key("Subject"):
- h["Subject"] = "RHN System Mail From %s" % os.uname()[1]
+ h["Subject"] = "RHN System Mail From %s" % idn_pune_to_unicode(os.uname()[1])
if not h.has_key("To"):
to = CFG.TRACEBACK_MAIL
else:
to = h["To"]
+ if not ("Content-Type" in h):
+ h["Content-Type"] = "text/plain; charset=utf-8"
if type(to) in [type([]), type(())]:
toaddrs = to
to = string.join(to, ', ')
@@ -49,8 +52,9 @@ def send(headers, body, sender = None, lazy = 0):
sender = headers["From"]
joined_headers = ''
for h in headers.keys():
- joined_headers += "%s: %s\n" % (h, headers[h])
+ joined_headers += "%s: %s\n" % (h, headers[h].encode('utf-8'))
server = smtplib.SMTP('localhost')
- server.sendmail(sender, toaddrs, "%s\n%s\n" % (joined_headers, body))
+ msg = "%s\n%s\n" % (joined_headers, body)
+ server.sendmail(sender, toaddrs, msg.encode('utf-8'))
server.quit()
commit bd0f7cabcac195d08f6c11a79cfb662681872bc7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 11:45:23 2011 +0200
683200 - convert hostname in subject from pune to unicode
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 07da5d8..4dfaabe 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -27,7 +27,7 @@ import time
import types
import exceptions
from optparse import Option, OptionParser
-from rhn.connections import idn_ascii_to_pune
+from rhn.connections import idn_ascii_to_pune, idn_pune_to_unicode
import gettext
t = gettext.translation('spacewalk-backend-server', fallback=True)
@@ -355,7 +355,7 @@ def sendMail(forceEmail=0):
if body:
print _("+++ sending log as an email +++")
headers = {
- 'Subject' : _('RHN Management Satellite sync. report from %s') % os.uname()[1],
+ 'Subject' : _('RHN Management Satellite sync. report from %s') % idn_pune_to_unicode(os.uname()[1]),
}
sndr = CFG.get('traceback_mail', 'root@localhost')
rhnMail.send(headers, body, sender=sndr)
commit 6f658cfa23f1eada2b2022d86b6a218b6daa5a06
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 10:38:28 2011 +0200
localize satsync messages
diff --git a/backend/satellite_tools/messages.py b/backend/satellite_tools/messages.py
index 6a4c7a3..ac671f2 100644
--- a/backend/satellite_tools/messages.py
+++ b/backend/satellite_tools/messages.py
@@ -20,63 +20,67 @@
All rights reserved.
"""
-failed_step = """
+import gettext
+t = gettext.translation('spacewalk-backend-server', fallback=True)
+_ = t.ugettext
+
+failed_step = _("""
ERROR: executing step %s. Error is:
%s
-"""
+""")
-file_dir_error = """
+file_dir_error = _("""
ERROR: there was a problem accessing the channel data from your temporary
repository. Did you migrate all of the data from the channel ISOs
do this directory? If so, please recheck the channels ISOs, ensure
that you have them all, and then iteratively remount and repopulate
the temporary repository (%s).
-"""
+""")
-syncer_error = """
+syncer_error = _("""
ERROR: there was a problem synchronizing the information.
Error message: %s
-"""
+""")
-iss_not_available = """
+iss_not_available = _("""
ERROR: The Server listed within iss-parent is not configured for ISS
capability.
Please review your configuration before trying again.
-"""
+""")
-parent_channel_error = """
+parent_channel_error = _("""
ERROR: a child-channel cannot be synced without its parent being synced as
well. A parent needs to be either (a) previously synced or (b) synced
in tandem with the desired child-channel. Missing parents for this
transaction:
%s
-"""
+""")
-invalid_channel_family_error = """
+invalid_channel_family_error = _("""
ERROR: you are not entitled to sync a channel in this set of channels.
Please contact your sales rep or RHN contact
-%s"""
+%s""")
-not_enough_diskspace = " ERROR: not enough free space (%s KB) on device."
+not_enough_diskspace = _(" ERROR: not enough free space (%s KB) on device.")
-package_fetch_successful = " %3d/%s Fetch successful: %s (%s bytes)"
-package_fetch_extinct = " %3d/%s Extinct package: %s"
-package_fetch_total_size = " Total size: %s"
-package_fetch_remain_size_time = " Downloaded %s of %s. Estimated remaining time: %s"
-package_fetch_failed = " %3d/%s Fetch unsuccessful: %s"
-package_fetch_summary = " RPM fetch summary: %s"
-package_fetch_summary_success = " success: %d"
-package_fetch_summary_failed = " failed: %d"
-package_fetch_summary_extinct = " extinct: %d"
+package_fetch_successful = _(" %3d/%s Fetch successful: %s (%s bytes)")
+package_fetch_extinct = _(" %3d/%s Extinct package: %s")
+package_fetch_total_size = _(" Total size: %s")
+package_fetch_remain_size_time = _(" Downloaded %s of %s. Estimated remaining time: %s")
+package_fetch_failed = _(" %3d/%s Fetch unsuccessful: %s")
+package_fetch_summary = _(" RPM fetch summary: %s")
+package_fetch_summary_success = _(" success: %d")
+package_fetch_summary_failed = _(" failed: %d")
+package_fetch_summary_extinct = _(" extinct: %d")
-package_parsing = " Retrieving / parsing *relevant* package metadata: %s (%s)"
-erratum_parsing = " Retrieving / parsing errata data: %s (%s)"
-kickstart_parsing = " Retrieving / parsing kickstart data: %s (%s)"
-kickstart_downloading = " Retrieving / parsing kickstart tree files: %s (%s)"
-package_importing = " Importing *relevant* package metadata: %s (%s)"
-warning_slow = " * WARNING: this may be a slow process."
-link_channel_packages = "Linking packages to channels"
-errata_importing = " Importing *relevant* errata: %s (%s)"
-kickstart_import_nothing_to_do = " No new kickstartable tree to import"
-kickstart_importing = "Importing kickstartable trees (%d)"
-kickstart_imported = "Imported kickstartable trees (%d)"
+package_parsing = _(" Retrieving / parsing *relevant* package metadata: %s (%s)")
+erratum_parsing = _(" Retrieving / parsing errata data: %s (%s)")
+kickstart_parsing = _(" Retrieving / parsing kickstart data: %s (%s)")
+kickstart_downloading = _(" Retrieving / parsing kickstart tree files: %s (%s)")
+package_importing = _(" Importing *relevant* package metadata: %s (%s)")
+warning_slow = _(" * WARNING: this may be a slow process.")
+link_channel_packages = _("Linking packages to channels")
+errata_importing = _(" Importing *relevant* errata: %s (%s)")
+kickstart_import_nothing_to_do = _(" No new kickstartable tree to import")
+kickstart_importing = _("Importing kickstartable trees (%d)")
+kickstart_imported = _("Imported kickstartable trees (%d)")
commit ae519c1e17d43d0a93a3abff5ab9bcb866597c58
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 10:31:16 2011 +0200
provide estimation about remaining time for downloading rpm
diff --git a/backend/satellite_tools/messages.py b/backend/satellite_tools/messages.py
index 3c67e3a..6a4c7a3 100644
--- a/backend/satellite_tools/messages.py
+++ b/backend/satellite_tools/messages.py
@@ -61,6 +61,8 @@ not_enough_diskspace = " ERROR: not enough free space (%s KB) on device."
package_fetch_successful = " %3d/%s Fetch successful: %s (%s bytes)"
package_fetch_extinct = " %3d/%s Extinct package: %s"
+package_fetch_total_size = " Total size: %s"
+package_fetch_remain_size_time = " Downloaded %s of %s. Estimated remaining time: %s"
package_fetch_failed = " %3d/%s Fetch unsuccessful: %s"
package_fetch_summary = " RPM fetch summary: %s"
package_fetch_summary_success = " success: %d"
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 59d167f..07da5d8 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -18,6 +18,7 @@
# __lang. imports__
+import datetime
import os
import sys
import stat
@@ -1726,11 +1727,25 @@ Please contact your RHN representative""") % (generation, sat_cert.generation))
pkgs_total = len(missing_fs_packages)
pkg_current = 0
cfg = config.initUp2dateConfig()
+ total_size = 0
+
+ #count size of missing packages
for package_id, path in missing_fs_packages:
pkg_current = pkg_current + 1
timestamp = short_package_collection.get_package_timestamp(package_id)
package = package_collection.get_package(package_id, timestamp)
+ total_size = total_size+package['package_size']
+
+ log(1, messages.package_fetch_total_size %
+ (self._bytes_to_fuzzy(total_size)))
+
+ processed_size = 0
+ start_time = round(time.time())
+ for package_id, path in missing_fs_packages:
+ pkg_current = pkg_current + 1
+ timestamp = short_package_collection.get_package_timestamp(package_id)
+ package = package_collection.get_package(package_id, timestamp)
checksum_type = package['checksum_type']
checksum = package['checksum']
package_size = package['package_size']
@@ -1791,7 +1806,15 @@ Please contact your RHN representative""") % (generation, sat_cert.generation))
# Package successfully saved
filename = os.path.basename(rpmManip.relative_path)
+
+ # Determine downloaded size and remaining time
size = package['package_size']
+ processed_size = processed_size + size
+ current_time = round(time.time())
+ remain_time = (datetime.timedelta(seconds=current_time-start_time))*(total_size/processed_size - 1)
+
+ log(1, messages.package_fetch_remain_size_time %
+ (self._bytes_to_fuzzy(processed_size), self._bytes_to_fuzzy(total_size), remain_time))
log(1, messages.package_fetch_successful %
(pkg_current, pkgs_total, filename, size))
@@ -1818,6 +1841,22 @@ Please contact your RHN representative""") % (generation, sat_cert.generation))
log(2, messages.package_fetch_summary_extinct % extinct_count,
notimeYN=1)
+ # Translate x bytes to string "x MB", "x GB" or "x kB"
+ def _bytes_to_fuzzy(self, bytes):
+ kilo=1024
+ mega=kilo*1024
+ giga=mega*1024
+ if (bytes/kilo == 0):
+ return "%d bytes" %(bytes)
+ elif (bytes/mega == 0):
+ return "%d kB" %(bytes / 1024)
+ elif (bytes/giga == 0):
+ mega_value=bytes / mega
+ return "%d.%d MB" %(mega_value, (bytes % mega) / kilo)
+ else:
+ giga_value=bytes / giga
+ return "%d.%d GB" %(giga_value, (bytes % giga) / mega)
+
def _get_package_stream(self, channel, package_id, nvrea, sources):
""" returns (filepath, stream), so in the case of a "wire source",
the return value is, of course, (None, stream)
13 years
2 commits - backend/server client/tools proxy/proxy
by Miroslav Suchý
backend/server/handlers/app/packages.py | 5 ++++-
client/tools/rhnpush/rhnpush.py | 2 +-
client/tools/rhnpush/rhnpush.sgml | 2 +-
client/tools/rhnpush/uploadLib.py | 18 +++++++-----------
proxy/proxy/pm/rhn_package_manager.py | 2 ++
proxy/proxy/pm/rhn_package_manager.sgml | 6 ++++++
6 files changed, 21 insertions(+), 14 deletions(-)
New commits:
commit 775c73607c6908bac95b0a41c6a9e91faeecc0fa
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 10:06:10 2011 +0200
678053 - add option --no-session-caching to rhn_package_manager
diff --git a/proxy/proxy/pm/rhn_package_manager.py b/proxy/proxy/pm/rhn_package_manager.py
index 7466156..337e6d0 100755
--- a/proxy/proxy/pm/rhn_package_manager.py
+++ b/proxy/proxy/pm/rhn_package_manager.py
@@ -76,6 +76,8 @@ def main():
Option( '--copyonly', action='store_true', help="Only copy packages; don't reimport"),
Option( '--test', action='store_true', help='Only print the packages to be pushed'),
Option( '--no-ssl', action='store_true', help='Turn off SSL (not recommended).'),
+ Option( '--no-session-caching', action='store_true',
+ help='Disables session-token authentication.'),
Option('-?','--usage', action='store_true', help="Briefly describe the options"),
]
# Process the command line arguments
diff --git a/proxy/proxy/pm/rhn_package_manager.sgml b/proxy/proxy/pm/rhn_package_manager.sgml
index 8a995a5..4c010d7 100644
--- a/proxy/proxy/pm/rhn_package_manager.sgml
+++ b/proxy/proxy/pm/rhn_package_manager.sgml
@@ -162,6 +162,12 @@ Manages RPM packages for the RHN proxy
<para>Turn off SSL (not recommended).</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>--no-session-caching</term>
+ <listitem>
+ <para>This option disabled session token authentication. Useful if you want to push to two or more different servers.</para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>-h, --help</term>
<listitem>
commit 698504378070e46be17e338f493005c928249167
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu May 5 09:58:24 2011 +0200
do not test if rhnParent can handle session caching
All servers since RHN Satellite 4.0.6 can do that.
But do not remove --no-session-caching since it can be useful when
you change rhnParent.
diff --git a/backend/server/handlers/app/packages.py b/backend/server/handlers/app/packages.py
index 7b24bb1..53714de 100644
--- a/backend/server/handlers/app/packages.py
+++ b/backend/server/handlers/app/packages.py
@@ -85,7 +85,10 @@ class Packages(RPC_Base):
self.functions.append('getSourcePackageMD5sumBySession')
def no_op(self):
- """ This is so the client can tell if the satellite supports session tokens or not. """
+ """ This is so the client can tell if the satellite supports session tokens or not.
+
+ This was used in rhnpush-5.5.26 and older. When there will be no such version of rhnpush in wild,
+ then this function can be safely removed."""
return 1
def uploadPackageInfo(self, username, password, info):
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index 40566df..ce7d4b1 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -83,7 +83,7 @@ def main():
Option( '--no-cache', action='store_true', help='Do not create a username/password cache'),
Option( '--extended-test', action='store_true', help='Perform a more verbose test'),
Option( '--no-session-caching', action='store_true',
- help='Disables session-token support. Useful for using rhnpush with pre-4.0.6 satellites.'),
+ help='Disables session-token authentication.'),
Option( '--tolerant', action='store_true',
help='If rhnpush errors while uploading a package, continue uploading the rest of the packages.')
]
diff --git a/client/tools/rhnpush/rhnpush.sgml b/client/tools/rhnpush/rhnpush.sgml
index 8c89b46..c76f69e 100644
--- a/client/tools/rhnpush/rhnpush.sgml
+++ b/client/tools/rhnpush/rhnpush.sgml
@@ -292,7 +292,7 @@ Utility to push binary and source RPMs into an RHN channel.
<varlistentry>
<term>--no-session-caching</term>
<listitem>
- <para>This option disabled session token support. Useful for satellites older than 4.0.6</para>
+ <para>This option disabled session token authentication. Useful if you want to push to two or more different servers.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index dcd4bc6..5925105 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -478,19 +478,15 @@ class UploadClass:
else:
self.setUsernamePassword()
- #1/3/06 wregglej 173287 rhnpush needs to work against older satellites, so we need a way to see if they can handle
- #session token authentication
def new_sat_test(self):
+ """ test if we can use session caching
+
+ Historically this function was used to test if rhnParent can handle session token authentication.
+ All curent satellites (4.0.6+) can do that. So it only return False, if we use --no-session-cachine.
+ """
if self.new_sat is None:
- if self.options.no_session_caching:
- self.new_sat = 0
- else:
- self.new_sat = 1
- try:
- self.server.packages.no_op()
- except:
- self.new_sat = 0
- return self.new_sat
+ self.new_sat = not self.options.no_session_caching
+ return self.new_sat
def _processFile(self, filename, relativeDir=None, source=None, nosig=None):
""" Processes a file
13 years
Changes to 'refs/tags/spacewalk-search-1.5.1-1'
by Tomas Lestach
Tag 'spacewalk-search-1.5.1-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-05-04 15:52 +0000
Tagging package [spacewalk-search] version [1.5.1-1] in directory [search-server/spacewalk-search/].
Changes since spacewalk-java-1.5.20-1:
Tomas Lestach (1):
Automatic commit of package [spacewalk-search] release [1.5.1-1].
---
rel-eng/packages/spacewalk-search | 2 +-
search-server/spacewalk-search/spacewalk-search.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
---
13 years
Changes to 'refs/tags/spacewalk-java-1.5.20-1'
by Tomas Lestach
Tag 'spacewalk-java-1.5.20-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2011-05-04 15:51 +0000
Tagging package [spacewalk-java] version [1.5.20-1] in directory [java/].
Changes since spacewalk-proxy-1.5.3-1:
Tomas Lestach (3):
648640 - introduce errata analyzer for rhn-search
648640 - keep fineGrained option when changing number of custom items
Automatic commit of package [spacewalk-java] release [1.5.20-1].
---
java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java | 1
java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java | 6 +-
java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java | 1
java/spacewalk-java.spec | 7 ++-
rel-eng/packages/spacewalk-java | 2
search-server/spacewalk-search/src/config/search/rhn_search.conf | 2
search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java | 17 +++++++
search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java | 22 +++++-----
8 files changed, 43 insertions(+), 15 deletions(-)
---
13 years
2 commits - java/spacewalk-java.spec rel-eng/packages search-server/spacewalk-search
by Tomas Lestach
java/spacewalk-java.spec | 7 ++++++-
rel-eng/packages/spacewalk-java | 2 +-
rel-eng/packages/spacewalk-search | 2 +-
search-server/spacewalk-search/spacewalk-search.spec | 6 +++++-
4 files changed, 13 insertions(+), 4 deletions(-)
New commits:
commit ac29f52e32e0735d0bf9322ae92230ebe8c7ae25
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed May 4 17:52:00 2011 +0200
Automatic commit of package [spacewalk-search] release [1.5.1-1].
diff --git a/rel-eng/packages/spacewalk-search b/rel-eng/packages/spacewalk-search
index a87d684..7ae1173 100644
--- a/rel-eng/packages/spacewalk-search
+++ b/rel-eng/packages/spacewalk-search
@@ -1 +1 @@
-1.4.1-1 search-server/spacewalk-search/
+1.5.1-1 search-server/spacewalk-search/
diff --git a/search-server/spacewalk-search/spacewalk-search.spec b/search-server/spacewalk-search/spacewalk-search.spec
index dd8f645..81250df 100644
--- a/search-server/spacewalk-search/spacewalk-search.spec
+++ b/search-server/spacewalk-search/spacewalk-search.spec
@@ -4,7 +4,7 @@ Name: spacewalk-search
Summary: Spacewalk Full Text Search Server
Group: Applications/Internet
License: GPLv2
-Version: 1.5.0
+Version: 1.5.1
Release: 1%{?dist}
# This src.rpm is cannonical upstream
# You can obtain it using this set of commands
@@ -117,6 +117,10 @@ fi
%{_sysconfdir}/logrotate.d/rhn-search
%changelog
+* Wed May 04 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.1-1
+- 648640 - introduce errata analyzer for rhn-search (tlestach(a)redhat.com)
+- Bumping package versions for 1.5 (msuchy(a)redhat.com)
+
* Mon Feb 07 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.4.1-1
- don't duplicate files from spacewalk-search.jar on filesystem
- move config.xml back to jar
commit dea82a049f4543be7edf0023813c5c3e468267ba
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed May 4 17:51:37 2011 +0200
Automatic commit of package [spacewalk-java] release [1.5.20-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 113c5a0..82441c9 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.5.19
+Version: 1.5.20
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -538,6 +538,11 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Wed May 04 2011 Tomas Lestach <tlestach(a)redhat.com> 1.5.20-1
+- 648640 - keep fineGrained option when changing number of custom items
+ (tlestach(a)redhat.com)
+- 648640 - introduce errata analyzer for rhn-search (tlestach(a)redhat.com)
+
* Wed May 04 2011 Miroslav Suchý 1.5.19-1
- sort inputs on the page
- 683200 - encode hostname to IDN in MonitoringConfig.do page
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index d6eebd7..833c6b1 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.5.19-1 java/
+1.5.20-1 java/
13 years
2 commits - java/code search-server/spacewalk-search
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java | 1
java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java | 6 +-
java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java | 1
search-server/spacewalk-search/src/config/search/rhn_search.conf | 2
search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java | 17 +++++++
search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java | 22 +++++-----
6 files changed, 36 insertions(+), 13 deletions(-)
New commits:
commit 6f9d4be39f29357a93f83f460bb76e378a5781c5
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed May 4 16:53:17 2011 +0200
648640 - keep fineGrained option when changing number of custom items
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java
index f2b4504..0b89789 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/PackageSearchAction.java
@@ -253,6 +253,7 @@ public class PackageSearchAction extends RhnAction {
request.setAttribute("allChannels", allChannels);
request.setAttribute("channel_filter", form.getString("channel_filter"));
request.setAttribute("relevant", relevantFlag ? "yes" : "no");
+ request.setAttribute(FINE_GRAINED, fineGrained ? "yes" : "no");
// Default where to search criteria
request.setAttribute("whereCriteria", searchCriteria);
diff --git a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
index 24d7aad..44c7394 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
@@ -163,6 +163,7 @@ public class ErrataSearchAction extends RhnAction {
String search = request.getParameter("search_string");
String viewmode = request.getParameter("view_mode");
+ String fineGrained = request.getParameter(FINE_GRAINED);
List searchOptions = new ArrayList();
// setup the option list for select box (view_mode).
@@ -174,6 +175,7 @@ public class ErrataSearchAction extends RhnAction {
request.setAttribute("search_string", search);
request.setAttribute("view_mode", viewmode);
request.setAttribute("searchOptions", searchOptions);
+ request.setAttribute(FINE_GRAINED, fineGrained);
// Process the dates, default the start date to yesterday
// and end date to today.
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java
index 0e7342e..cc8eb06 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/SystemSearchSetupAction.java
@@ -165,6 +165,7 @@ public class SystemSearchSetupAction extends RhnAction implements Listable {
request.setAttribute(VIEW_MODE, request.getParameter(VIEW_MODE));
request.setAttribute(SEARCH_STRING, request.getParameter(SEARCH_STRING));
request.setAttribute(WHERE_TO_SEARCH, whereToSearch);
+ request.setAttribute(FINE_GRAINED, request.getParameter(FINE_GRAINED));
if (invertResults) {
request.setAttribute(INVERT_RESULTS, "on");
commit 665963d3eb98066909fb7e6496bc90bb57b6d38f
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon May 2 15:54:25 2011 +0200
648640 - introduce errata analyzer for rhn-search
diff --git a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
index e3cf676..24d7aad 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/errata/ErrataSearchAction.java
@@ -569,11 +569,11 @@ public class ErrataSearchAction extends RhnAction {
query = escapeSpecialChars(query);
return "(description:(" + query + ") topic:(" + query + ") solution:(" +
query + ") notes:(" + query + ") product:(" + query + ")" +
- " advisoryName:(" + query + ") synopsis:(" + query + "))";
+ " name:(" + query + ") synopsis:(" + query + "))";
}
else if (OPT_ADVISORY.equals(mode)) {
query = escapeSpecialChars(query);
- return "(advisoryName:(" + query + "))";
+ return "(name:(" + query + "))";
}
else if (OPT_PKG_NAME.equals(mode)) {
// when searching the name field, we also want to include the filename
diff --git a/search-server/spacewalk-search/src/config/search/rhn_search.conf b/search-server/spacewalk-search/src/config/search/rhn_search.conf
index 6a3cb7d..d6f0b64 100644
--- a/search-server/spacewalk-search/src/config/search/rhn_search.conf
+++ b/search-server/spacewalk-search/src/config/search/rhn_search.conf
@@ -4,7 +4,7 @@ search.max_hits_returned=500
search.connection.driver_class=oracle.jdbc.driver.OracleDriver
search.score_threshold=.10
search.system_score_threshold=.01
-search.errata_score_threshold=.20
+search.errata_score_threshold=.01
search.errata.advisory_score_threshold=.30
search.min_ngram = 1
search.max_ngram = 5
diff --git a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java b/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java
index 58609f5..271dab6 100644
--- a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java
+++ b/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/IndexManager.java
@@ -455,6 +455,9 @@ public class IndexManager {
else if (indexName.compareTo(BuilderFactory.SERVER_TYPE) == 0) {
return getServerAnalyzer();
}
+ else if (indexName.compareTo(BuilderFactory.ERRATA_TYPE) == 0) {
+ return getErrataAnalyzer();
+ }
else if (indexName.compareTo(BuilderFactory.SNAPSHOT_TAG_TYPE) == 0) {
return getSnapshotTagAnalyzer();
}
@@ -569,7 +572,7 @@ public class IndexManager {
}
}
else if (indexName.compareTo(BuilderFactory.ERRATA_TYPE) == 0) {
- if (guessMainQueryTerm.compareTo("advisoryName") == 0) {
+ if (guessMainQueryTerm.compareTo("name") == 0) {
if (hits.score(x) < errata_advisory_score_threshold) {
if (log.isDebugEnabled()) {
log.debug("hits.score(" + x + ") is " + hits.score(x));
@@ -738,6 +741,18 @@ public class IndexManager {
return analyzer;
}
+ private Analyzer getErrataAnalyzer() {
+ PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
+ NGramAnalyzer(min_ngram, max_ngram));
+ analyzer.addAnalyzer("advisoryName", new KeywordAnalyzer());
+ analyzer.addAnalyzer("synopsis", new StandardAnalyzer());
+ analyzer.addAnalyzer("description", new StandardAnalyzer());
+ analyzer.addAnalyzer("topic", new StandardAnalyzer());
+ analyzer.addAnalyzer("solution", new StandardAnalyzer());
+
+ return analyzer;
+ }
+
private Analyzer getSnapshotTagAnalyzer() {
PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
NGramAnalyzer(min_ngram, max_ngram));
diff --git a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java b/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java
index 665ff51..ad5a01d 100644
--- a/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java
+++ b/search-server/spacewalk-search/src/java/com/redhat/satellite/search/index/builder/ErrataDocumentBuilder.java
@@ -26,9 +26,9 @@ import java.util.Map;
* @version $Rev$
*/
public class ErrataDocumentBuilder implements DocumentBuilder {
-
+
// TODO: add some information about fields and their indexing states.
-
+
/**
* {@inheritDoc}
*/
@@ -36,25 +36,29 @@ public class ErrataDocumentBuilder implements DocumentBuilder {
Document doc = new Document();
doc.add(new Field("id", objId.toString(), Field.Store.YES,
Field.Index.UN_TOKENIZED));
-
for (Iterator<String> iter = metadata.keySet().iterator(); iter.hasNext();) {
Field.Store store = Field.Store.NO;
Field.Index tokenize = Field.Index.TOKENIZED;
-
+
String name = iter.next();
String value = metadata.get(name);
-
- if (name.equals("name")) {
+
+ if (name.equals("name") || name.equals("advisoryName")) {
store = Field.Store.YES;
}
- else if (name.equals("advisoryName")) {
- store = Field.Store.YES;
+ else if (name.equals("synopsis") || name.equals("description") ||
+ name.equals("topic") || name.equals("solution")) {
+ // index, but do not store
+ }
+ else {
+ // skip - do not store or index
+ continue;
}
doc.add(new Field(name, String.valueOf(value), store,
tokenize));
- }
+ }
return doc;
}
}
13 years
Changes to 'refs/tags/spacewalk-proxy-1.5.3-1'
by Miroslav Suchý
Tag 'spacewalk-proxy-1.5.3-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2011-05-04 15:25 +0000
Tagging package [spacewalk-proxy] version [1.5.3-1] in directory [proxy/proxy/].
Changes since spacewalk-setup-1.5.4-1:
Miroslav Suchý (2):
do not import modules through magic
Automatic commit of package [spacewalk-proxy] release [1.5.3-1].
---
proxy/proxy/apacheHandler.py | 8 ++++++--
proxy/proxy/apacheServer.py | 6 ++++--
proxy/proxy/broker/rhnBroker.py | 6 ++++--
proxy/proxy/broker/rhnRepository.py | 5 ++++-
proxy/proxy/pm/rhn_package_manager.py | 2 +-
proxy/proxy/redirect/rhnRedirect.py | 7 +++++--
proxy/proxy/rhnAuthCacheClient.py | 6 ++++--
proxy/proxy/rhnProxyAuth.py | 7 +++++--
proxy/proxy/rhnShared.py | 7 +++++--
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
11 files changed, 43 insertions(+), 18 deletions(-)
---
13 years
2 commits - proxy/proxy rel-eng/packages
by Miroslav Suchý
proxy/proxy/apacheHandler.py | 8 ++++++--
proxy/proxy/apacheServer.py | 6 ++++--
proxy/proxy/broker/rhnBroker.py | 6 ++++--
proxy/proxy/broker/rhnRepository.py | 5 ++++-
proxy/proxy/pm/rhn_package_manager.py | 2 +-
proxy/proxy/redirect/rhnRedirect.py | 7 +++++--
proxy/proxy/rhnAuthCacheClient.py | 6 ++++--
proxy/proxy/rhnProxyAuth.py | 7 +++++--
proxy/proxy/rhnShared.py | 7 +++++--
proxy/proxy/spacewalk-proxy.spec | 5 ++++-
rel-eng/packages/spacewalk-proxy | 2 +-
11 files changed, 43 insertions(+), 18 deletions(-)
New commits:
commit a12e6c81c6ccac8c7a336cd6c780435bf7583869
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 4 17:25:16 2011 +0200
Automatic commit of package [spacewalk-proxy] release [1.5.3-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec
index 82c89e9..b969419 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.5.2
+Version: 1.5.3
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python
@@ -331,6 +331,9 @@ fi
%changelog
+* Wed May 04 2011 Miroslav Suchý 1.5.3-1
+- do not import modules through magic
+
* Tue Apr 19 2011 Miroslav Suchý <msuchy(a)redhat.com> 1.5.2-1
- 697447 - handle all other request
diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy
index e3a46c2..eb19afc 100644
--- a/rel-eng/packages/spacewalk-proxy
+++ b/rel-eng/packages/spacewalk-proxy
@@ -1 +1 @@
-1.5.2-1 proxy/proxy/
+1.5.3-1 proxy/proxy/
commit de868e9f42ebd3d40ad5a7bd034c9192ce1719ac
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed May 4 17:18:57 2011 +0200
do not import modules through magic
diff --git a/proxy/proxy/apacheHandler.py b/proxy/proxy/apacheHandler.py
index 2828c60..4c358c2 100644
--- a/proxy/proxy/apacheHandler.py
+++ b/proxy/proxy/apacheHandler.py
@@ -26,8 +26,12 @@ from rhnConstants import *
from rhn import rpclib, connections
## common imports
-from spacewalk.common import rhnApache, rhnFlags, log_debug, log_error, CFG, \
- UserDictCase, Traceback, rhnFault, rhnException, apache
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common.rhnLog import initLOG, log_debug, log_error
+from spacewalk.common.rhnApache import rhnApache
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common.rhnException import rhnFault, rhnException
+from spacewalk.common import rhnFlags, UserDictCase, apache
from spacewalk.common.rhnLib import setHeaderValue
## local imports
diff --git a/proxy/proxy/apacheServer.py b/proxy/proxy/apacheServer.py
index e898612..1fb20e2 100644
--- a/proxy/proxy/apacheServer.py
+++ b/proxy/proxy/apacheServer.py
@@ -17,8 +17,10 @@
# $Id: apacheServer.py,v 1.81 2005/07/05 17:39:03 wregglej Exp $
# common module imports
-from spacewalk.common import CFG, initCFG, initLOG, log_setreq, Traceback, \
- log_debug, apache
+from spacewalk.common.rhnConfig import CFG, initCFG
+from spacewalk.common.rhnLog import initLOG, log_setreq, log_debug
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common import apache
class HandlerWrap:
""" Wrapper handlers to catch unwanted exceptions """
diff --git a/proxy/proxy/broker/rhnBroker.py b/proxy/proxy/broker/rhnBroker.py
index aa6dae3..2849668 100644
--- a/proxy/proxy/broker/rhnBroker.py
+++ b/proxy/proxy/broker/rhnBroker.py
@@ -23,8 +23,10 @@ import re
# common module imports
from spacewalk.common.rhnLib import parseUrl
-from spacewalk.common import UserDictCase, rhnFlags, log_debug, log_error, CFG, \
- rhnFault, apache
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common.rhnException import rhnFault
+from spacewalk.common import UserDictCase, rhnFlags, apache
from spacewalk.common.rhnTranslate import _
# local module imports
diff --git a/proxy/proxy/broker/rhnRepository.py b/proxy/proxy/broker/rhnRepository.py
index e50b6d4..928b377 100644
--- a/proxy/proxy/broker/rhnRepository.py
+++ b/proxy/proxy/broker/rhnRepository.py
@@ -30,7 +30,10 @@ from operator import truth
import xmlrpclib
## common imports
-from spacewalk.common import rhnRepository, log_debug, log_error, CFG, rhnFault
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common.rhnException import rhnFault
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common import rhnRepository
from spacewalk.common.rhnTranslate import _
## local imports
diff --git a/proxy/proxy/pm/rhn_package_manager.py b/proxy/proxy/pm/rhn_package_manager.py
index 8ed90f7..7466156 100755
--- a/proxy/proxy/pm/rhn_package_manager.py
+++ b/proxy/proxy/pm/rhn_package_manager.py
@@ -44,7 +44,7 @@ except ImportError:
from optik import Option, OptionParser
# RHN imports
-from spacewalk.common import CFG, initCFG
+from spacewalk.common.rhnConfig import CFG, initCFG
from spacewalk.common.rhnLib import parseUrl
initCFG('proxy.package_manager')
diff --git a/proxy/proxy/redirect/rhnRedirect.py b/proxy/proxy/redirect/rhnRedirect.py
index 8e08229..b5f8abe 100644
--- a/proxy/proxy/redirect/rhnRedirect.py
+++ b/proxy/proxy/redirect/rhnRedirect.py
@@ -21,8 +21,11 @@ import socket
import re
# common module imports
-from spacewalk.common import log_debug, log_error, CFG, rhnFlags, rhnFault, rhnLib, \
- Traceback, apache
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common.rhnException import rhnFault
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common import rhnFlags, rhnLib, apache
from spacewalk.common.rhnTranslate import _
# local module imports
diff --git a/proxy/proxy/rhnAuthCacheClient.py b/proxy/proxy/rhnAuthCacheClient.py
index 23b16c9..833b087 100644
--- a/proxy/proxy/rhnAuthCacheClient.py
+++ b/proxy/proxy/rhnAuthCacheClient.py
@@ -23,7 +23,9 @@
import socket
## local imports
-from spacewalk.common import log_debug, log_error, Traceback, rhnFault
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common.rhnException import rhnFault
from spacewalk.common.rhnTranslate import _
from rhnAuthProtocol import CommunicationError, send, recv
from xmlrpclib import Fault
@@ -171,7 +173,7 @@ class Shelf:
#-------------------------------------------------------------------------------
# test code
if __name__ == '__main__':
- from spacewalk.common import initCFG
+ from spacewalk.common.rhnConfig import initCFG
initCFG("proxy.broker")
s = Shelf(('localhost', 9999))
s['1234'] = [1, 2, 3, 4, None, None]
diff --git a/proxy/proxy/rhnProxyAuth.py b/proxy/proxy/rhnProxyAuth.py
index b791185..bb8c988 100644
--- a/proxy/proxy/rhnProxyAuth.py
+++ b/proxy/proxy/rhnProxyAuth.py
@@ -30,8 +30,11 @@ from rhn import SSL
## common imports
from spacewalk.common.rhnLib import parseUrl
-from spacewalk.common import Traceback, log_debug, log_error, CFG, \
- rhnCache, rhnFault
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common.rhnException import rhnFault
+from spacewalk.common import rhnCache
from spacewalk.common.rhnTranslate import _
diff --git a/proxy/proxy/rhnShared.py b/proxy/proxy/rhnShared.py
index d11134e..84131ef 100644
--- a/proxy/proxy/rhnShared.py
+++ b/proxy/proxy/rhnShared.py
@@ -26,8 +26,11 @@ from rhn import connections
from rhn.SSL import TimeoutException
## common imports
-from spacewalk.common import UserDictCase, rhnFlags, log_debug, log_error, \
- Traceback, CFG, rhnException, rhnFault, rhnLib, apache
+from spacewalk.common.rhnTB import Traceback
+from spacewalk.common.rhnConfig import CFG
+from spacewalk.common.rhnException import rhnFault, rhnException
+from spacewalk.common.rhnLog import log_debug, log_error
+from spacewalk.common import UserDictCase, rhnFlags, rhnLib, apache
from spacewalk.common.rhnTranslate import _
## local imports
13 years
Changes to 'refs/tags/spacewalk-setup-1.5.4-1'
by Jan Pazdziora
Tag 'spacewalk-setup-1.5.4-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-05-04 14:29 +0000
Tagging package [spacewalk-setup] version [1.5.4-1] in directory [spacewalk/setup/].
Changes since oracle-lib-compat-11.2.0.4-1:
Jan Pazdziora (2):
On RHEL 6, tomcat6 no longer sources the setenv.sh so we need to source it ourselves.
Automatic commit of package [spacewalk-setup] release [1.5.4-1].
---
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/share/tomcatX.conf.3 | 2 ++
spacewalk/setup/spacewalk-setup.spec | 6 +++++-
3 files changed, 8 insertions(+), 2 deletions(-)
---
13 years
rel-eng/packages spacewalk/setup
by Jan Pazdziora
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 9f4ac0cd2517c3784b3764312341829afb216b58
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed May 4 16:29:13 2011 +0200
Automatic commit of package [spacewalk-setup] release [1.5.4-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index d3e9a2b..d6cfb6c 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-1.5.3-1 spacewalk/setup/
+1.5.4-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index a6f29c4..f050900 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,5 +1,5 @@
Name: spacewalk-setup
-Version: 1.5.3
+Version: 1.5.4
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -101,6 +101,10 @@ rm -rf %{buildroot}
%attr(755, apache, root) %{_var}/spacewalk
%changelog
+* Wed May 04 2011 Jan Pazdziora 1.5.4-1
+- On RHEL 6, tomcat6 no longer sources the setenv.sh so we need to source it
+ ourselves.
+
* Wed Apr 27 2011 Simon Lukasik <slukasik(a)redhat.com> 1.5.3-1
- Drop the schema only if exists (slukasik(a)redhat.com)
13 years