client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/man/en/rhn_register.8 | 14 ++++++-----
client/rhel/rhn-client-tools/man/en/rhnreg_ks.8 | 25 +++++++++++----------
2 files changed, 22 insertions(+), 17 deletions(-)
New commits:
commit d9756c02ec93a11fa7c16b0436ba8d27484edf15
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Feb 4 14:18:08 2011 +0100
671041 - substitute RHN with "RHN Satellite or RHN Classic"
diff --git a/client/rhel/rhn-client-tools/man/en/rhn_register.8 b/client/rhel/rhn-client-tools/man/en/rhn_register.8
index 39a1941..b7e80b2 100644
--- a/client/rhel/rhn-client-tools/man/en/rhn_register.8
+++ b/client/rhel/rhn-client-tools/man/en/rhn_register.8
@@ -14,9 +14,9 @@
.\" along with this man page; if not, write to the Free Software
.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
-.TH RHN_REGISTER 8 "2010 August 30" "Linux" "Red Hat, Inc."
+.TH RHN_REGISTER 8 "2011 February 4" "Linux" "Red Hat, Inc."
.SH NAME
-rhn_register \- Connect to Red Hat Network.
+rhn_register \- Connect to RHN Satellite or Red Hat Network Classic.
.SH SYNOPSIS
rhn_register [\fIoptions\fP]
@@ -25,8 +25,8 @@ rhn_register [\fIoptions\fP]
.PP
\fBrhn_register\fP is a client program that registers your system with
-.B Red Hat Network
-(or a Red Hat Network Satellite). After registering, your system can recieve
+.B Red Hat Network Classic
+(or a RHN Satellite). After registering, your system can recieve
software updates, install new software, and remotely manage your system.
It can run both in graphical and text modes.
@@ -59,7 +59,9 @@ Show a help message and exit.
.IP \fI/etc/sysconfig/rhn/systemid\fP
The digital server ID for this machine if the system has been registered onto
-.B Red Hat Network.
+.B RHN Satellite
+or
+.B Red Hat Network Classic.
This file does not exist otherwise.
.br
.IP \fI/etc/sysconfig/rhn/up2date\fP
@@ -83,7 +85,7 @@ Report bugs to <http://bugzilla.redhat.com>.
.SH COPYRIGHT
.PP
-Copyright \(co 1999\-2010 Red Hat, Inc.
+Copyright \(co 1999\-2011 Red Hat, Inc.
.PP
This is free software; see the source for copying conditions. There is
diff --git a/client/rhel/rhn-client-tools/man/en/rhnreg_ks.8 b/client/rhel/rhn-client-tools/man/en/rhnreg_ks.8
index f8384ea..aac4bb9 100644
--- a/client/rhel/rhn-client-tools/man/en/rhnreg_ks.8
+++ b/client/rhel/rhn-client-tools/man/en/rhnreg_ks.8
@@ -14,10 +14,11 @@
.\" along with this man page; if not, write to the Free Software
.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
-.TH RHNREG_KS 8 "2010 August 30" "Linux" "Red Hat, Inc."
+.TH RHNREG_KS 8 "2011 February 4" "Linux" "Red Hat, Inc."
.SH NAME
-rhnreg_ks \- A program for non interactively registering systems to Red Hat Network.
+rhnreg_ks \- A program for non interactively registering systems to RHN Satellite
+or Red Hat Network Classic.
.SH SYNOPSIS
@@ -25,8 +26,8 @@ rhnreg_ks [\fIoptions\fP]
.SH DESCRIPTION
.PP
-\fVrhnreg_ks\fR is a utility for registering a system with the Red Hat
-Network. It is designed to be used in a non-interactive environment
+\fVrhnreg_ks\fR is a utility for registering a system with the RHN Satellite or Red Hat
+Network Classic. It is designed to be used in a non-interactive environment
(a kickstart style install, for example). All the information can
be specified on the command line or stdin.
@@ -34,11 +35,11 @@ be specified on the command line or stdin.
.IP "\fB--profilename\fP"
Specify the profile name that should be used as an identifier for
-the system in Red Hat Network
+the system in RHN Satellite, Red Hat Network Classic
.br
.IP "\fB--username\fP"
-The username to register the system with under Red Hat Network. This
-can be an existing Red Hat Network username, or a new username.
+The username to register the system with under RHN Satellite or Red Hat Network Classic. This
+can be an existing RHN Satellite or Red Hat Network Classic username, or a new username.
.br
.IP "\fB--password\fP"
The password associated with the username specified with the \fB--username\fR
@@ -96,7 +97,9 @@ Show a help message and exit.
.IP \fI/etc/sysconfig/rhn/systemid\fP
The digital server ID for this machine if the system has been registered onto
-.B Red Hat Network.
+.B RHN Satellite
+or
+.B Red Hat Network Classic.
This file does not exist otherwise.
.br
.IP \fI/etc/sysconfig/rhn/up2date\fP
@@ -104,7 +107,7 @@ The common configuration file used by RHN client programs.
.SH "EXAMPLES"
-Register a new system to Red Hat Network:
+Register a new system to Red Hat Network Classic:
.RS
.nf
@@ -112,7 +115,7 @@ rhnreg_ks --profilename "example_profile_name" --username "someexampleuser" --pa
.fi
.RE
-Register a new system to Red Hat Network with contact info:
+Register a new system to Red Hat Network Classic with contact info:
.RS
.nf
@@ -149,7 +152,7 @@ Report bugs to <http://bugzilla.redhat.com>.
.SH COPYRIGHT
.PP
-Copyright \(co 1999\-2010 Red Hat, Inc.
+Copyright \(co 1999\-2011 Red Hat, Inc.
.PP
This is free software; see the source for copying conditions. There is
13 years, 4 months
client/rhel
by Miroslav Suchý
client/rhel/yum-rhn-plugin/rhnplugin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 49337b6246dcbc0b4a31efd20520c84176be949d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Feb 4 13:51:48 2011 +0100
671032 - specify RHN as "RHN Satellite or RHN Classic"
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.py b/client/rhel/yum-rhn-plugin/rhnplugin.py
index 6bc0e0d..cc32716 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.py
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.py
@@ -87,7 +87,7 @@ def prereposetup_hook(conduit):
rhn_enabled = False
return
- RHN_DISABLED = _("RHN support will be disabled.")
+ RHN_DISABLED = _("RHN Satellite or RHN Classic support will be disabled.")
if not os.geteuid()==0:
# If non-root notify user RHN repo not accessible
13 years, 4 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/diskImportLib.py | 26 --------------------------
1 file changed, 26 deletions(-)
New commits:
commit e38d6a534365279689da584347b8736afa7b4ed4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 4 13:31:51 2011 +0100
With previous removals, getChannelAttribute is not used anymore, removing.
diff --git a/backend/satellite_tools/diskImportLib.py b/backend/satellite_tools/diskImportLib.py
index 55f683d..7dae65a 100644
--- a/backend/satellite_tools/diskImportLib.py
+++ b/backend/satellite_tools/diskImportLib.py
@@ -43,32 +43,6 @@ class Backend:
def get_backend():
return Backend().get_backend()
-# Retrieves an attribute for a channel dumped in XML
-def getChannelAttribute(mountPoint, channel, attribute, handler):
- dumper = xmlDiskSource.ChannelDiskSource(mountPoint=mountPoint)
- dumper.setChannel(channel)
- f = dumper.load()
-
- # save the previous container
- oldContainer = handler.get_container(xmlSource.ChannelContainer.container_name)
- # And replace it with the default one - only saves stuff in the batch
- newContainer = xmlSource.ChannelContainer()
- handler.set_container(newContainer)
-
- # Process the information
- handler.process(f)
-
- channel = newContainer.batch[0]
-
- # Cleanup
- handler.reset()
-
- # Restore the old container
- handler.set_container(oldContainer)
-
- return channel.get(attribute)
-
-
# Functions for dumping packages
def rpmsPath(obj_id, mountPoint, sources=0):
# returns the package path (for exporter/importer only)
13 years, 4 months
2 commits - backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/diskImportLib.py | 18 ------------------
1 file changed, 18 deletions(-)
New commits:
commit 5c161578b7e085531f698f757cd65fd9a82e76a5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 4 13:30:38 2011 +0100
The listChannelErrata is dead code by now (after the ISO dumper removal).
diff --git a/backend/satellite_tools/diskImportLib.py b/backend/satellite_tools/diskImportLib.py
index 68e09de..55f683d 100644
--- a/backend/satellite_tools/diskImportLib.py
+++ b/backend/satellite_tools/diskImportLib.py
@@ -69,11 +69,6 @@ def getChannelAttribute(mountPoint, channel, attribute, handler):
return channel.get(attribute)
-# Lists the errata linked to a specific channel
-def listChannelErrata(mountPoint, channel, handler):
- return getChannelAttribute(mountPoint, channel, 'errata', handler)
-
-
# Functions for dumping packages
def rpmsPath(obj_id, mountPoint, sources=0):
# returns the package path (for exporter/importer only)
commit 4ddfb5907bbb92a5f202f8d2e3c5d592096d905a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 4 13:29:53 2011 +0100
The listChannelPackages is dead code by now (after the ISO dumper removal).
diff --git a/backend/satellite_tools/diskImportLib.py b/backend/satellite_tools/diskImportLib.py
index 4cd146d..68e09de 100644
--- a/backend/satellite_tools/diskImportLib.py
+++ b/backend/satellite_tools/diskImportLib.py
@@ -69,19 +69,6 @@ def getChannelAttribute(mountPoint, channel, attribute, handler):
return channel.get(attribute)
-# Lists the packages linked to a specific channel
-def listChannelPackages(mountPoint, channel, handler, sources=0, all=0):
- if sources:
- return getChannelAttribute(mountPoint, channel, 'source-packages',
- handler)
- if all:
- # All packages requested
- ret = getChannelAttribute(mountPoint, channel, 'all-packages', handler)
- if ret:
- return ret
- return getChannelAttribute(mountPoint, channel, 'packages', handler)
-
-
# Lists the errata linked to a specific channel
def listChannelErrata(mountPoint, channel, handler):
return getChannelAttribute(mountPoint, channel, 'errata', handler)
13 years, 4 months
backend/satellite_tools
by Jan Pazdziora
backend/satellite_tools/diskImportLib.py | 29 -----------------------------
1 file changed, 29 deletions(-)
New commits:
commit a015942569c14d5c1f97dbb3029316b76149f666
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 4 13:25:57 2011 +0100
The getKickstartTree is dead code by now (after the ISO dumper removal).
diff --git a/backend/satellite_tools/diskImportLib.py b/backend/satellite_tools/diskImportLib.py
index 5afaca0..4cd146d 100644
--- a/backend/satellite_tools/diskImportLib.py
+++ b/backend/satellite_tools/diskImportLib.py
@@ -87,35 +87,6 @@ def listChannelErrata(mountPoint, channel, handler):
return getChannelAttribute(mountPoint, channel, 'errata', handler)
-# Retrieves an attribute for a channel dumped in XML
-def getKickstartTree(mountPoint, ks_label, handler):
- ds = xmlDiskSource.KickstartDataDiskSource(mountPoint=mountPoint)
- ds.setID(ks_label)
- f = ds.load()
-
- # save the previous container
- oldContainer = handler.get_container(xmlSource.KickstartableTreesContainer.container_name)
- # And replace it with the default one - only saves stuff in the batch
- newContainer = xmlSource.KickstartableTreesContainer()
- handler.set_container(newContainer)
-
- # Process the information
- handler.process(f)
-
- if not newContainer.batch:
- return None
-
- kstree = newContainer.batch[0]
-
- # Cleanup
- handler.reset()
-
- # Restore the old container
- handler.set_container(oldContainer)
-
- return kstree
-
-
# Functions for dumping packages
def rpmsPath(obj_id, mountPoint, sources=0):
# returns the package path (for exporter/importer only)
13 years, 4 months
backend/satellite_exporter
by Jan Pazdziora
backend/satellite_exporter/handlers/non_auth_dumper.py | 34 -----------------
1 file changed, 34 deletions(-)
New commits:
commit c6b88d2fe445ffc50a6990c6a45ed2ca75cb0503
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Feb 4 13:13:48 2011 +0100
With _lookup_last_modified gone, _lookup_last_modified_packages and _lookup_last_modified_ks_trees are dead code, removing.
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 8d011ba..3ecee89 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -530,40 +530,6 @@ class ChannelsDumper(dumper.ChannelsDumper):
c = exportLib.ChannelDumper(self._writer, data)
c.dump()
-_query_lookup_last_modified_packages = rhnSQL.Statement("""
- select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnPackage
- where id = :id
-""")
-def _lookup_last_modified_packages(package_ids):
- h = rhnSQL.prepare(_query_lookup_last_modified_packages)
- ret = []
- for pid in package_ids:
- h.execute(id=pid)
- row = h.fetchone_dict()
- assert row, "Invalid package id %s" % pid
- ret.append((pid, row['last_modified']))
- return ret
-
-_query_lookup_last_modified_ks_trees = rhnSQL.Statement("""
- select TO_CHAR(kt.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnKickstartableTree kt, rhnChannel c
- where kt.channel_id = c.id
- and c.label = :channel_label
- and kt.label = :ks_label
- and kt.org_id is null
-""")
-def _lookup_last_modified_ks_trees(channel_label, ks_trees):
- h = rhnSQL.prepare(_query_lookup_last_modified_ks_trees)
- ret = []
- for klabel in ks_trees:
- h.execute(channel_label=channel_label, ks_label=klabel)
- row = h.fetchone_dict()
- assert row, "Invalid kickstart label %s for channel %s" % (
- klabel, channel_label)
- ret.append((klabel, row['last_modified']))
- return ret
-
def _get_path_from_cursor(h):
# Function shared between other retrieval functions
rs = h.fetchall_dict()
13 years, 4 months
client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py | 11 +
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 69 ++++++++++
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 60 ++++++++
client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py | 6
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 45 +++++-
client/rhel/yum-rhn-plugin/rhnplugin.conf | 2
6 files changed, 185 insertions(+), 8 deletions(-)
New commits:
commit 053fa0a19e21bce4eafc99fd7d2d44bd70428c14
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Feb 4 12:11:57 2011 +0100
671032 - disable rhnplugin by default and enable it only after successful registration
diff --git a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
index d732c9e..e1b6c4d 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
@@ -170,6 +170,17 @@ class RegisterKsCli(rhncli.RhnCli):
if not self.options.norhnsd:
rhnreg.startRhnsd()
+ try:
+ if rhnreg.YumRHNPluginPackagePresent():
+ if rhnreg.YumRHNPluginConfPresent():
+ if not rhnreg.YumRhnPluginEnabled():
+ rhnreg.enableYumRhnPlugin()
+ else:
+ rhnreg.createDefaultYumRHNPluginConf()
+ else:
+ sys.stderr.write(_("Warning: yum-rhn-plugin is not present, could not enable it."))
+ except IOError, e:
+ sys.stderr.write(_("Warning: Could not open /etc/yum/pluginconf.d/rhnplugin.conf\nyum-rhn-plugin is not enabled.\n") + e.errmsg)
RegisterKsCli.__runRhnCheck()
@staticmethod
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index b8e53db..72c4f49 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -8,6 +8,8 @@
# Daniel Benamy <dbenamy(a)redhat.com>
import os
+import re
+import rpm
import sys
import up2dateUtils
@@ -33,6 +35,7 @@ _ = gettext.gettext
# global variables
+YUM_PLUGIN_CONF = '/etc/yum/pluginconf.d/rhnplugin.conf'
#SYSID_DIR = /tmp
SYSID_DIR = "/etc/sysconfig/rhn"
REMIND_FILE = "%s/rhn_register_remind" % SYSID_DIR
@@ -631,3 +634,69 @@ def spawnRhnCheckForUI():
else:
log.log_me("Warning: unable to run rhn_check")
+def enableYumRhnPlugin():
+ """ enable yum-rhn-plugin by setting enabled=1 in file
+ /etc/yum/pluginconf.d/rhnplugin.conf
+ Can thrown IOError exception.
+ """
+ f = open(YUM_PLUGIN_CONF, 'r')
+ lines = f.readlines()
+ f.close()
+ main_section = False
+ f = open(YUM_PLUGIN_CONF, 'w')
+ for line in lines:
+ if re.match("^\[.*]", line):
+ if re.match("^\[main]", line):
+ main_section = True
+ else:
+ main_section = False
+ if main_section:
+ line = re.sub('^(\s*)enabled\s*=.+', r'\1enabled = 1', line)
+ f.write(line)
+ f.close()
+
+def YumRhnPluginEnabled():
+ """ Returns True if yum-rhn-plugin is enabled
+ Can thrown IOError exception.
+ """
+ f = open(YUM_PLUGIN_CONF, 'r')
+ lines = f.readlines()
+ f.close()
+ main_section = False
+ result = False
+ for line in lines:
+ if re.match("^\[.*]", line):
+ if re.match("^\[main]", line):
+ main_section = True
+ else:
+ main_section = False
+ if main_section:
+ m = re.match('^\s*enabled\s*=\s*([0-9])', line)
+ if m:
+ if int(m.group(1)):
+ result = True
+ else:
+ result = False
+ return result
+
+def createDefaultYumRHNPluginConf():
+ """ Create file /etc/yum/pluginconf.d/rhnplugin.conf with default values """
+ f = open(YUM_PLUGIN_CONF, 'w')
+ f.write("""[main]
+enabled = 1
+gpgcheck = 1""")
+ f.close()
+
+def YumRHNPluginConfPresent():
+ """ Returns true if /etc/yum/pluginconf.d/rhnplugin.conf is presented """
+ try:
+ os.stat(YUM_PLUGIN_CONF)
+ return True
+ except OSError:
+ return False
+
+def YumRHNPluginPackagePresent():
+ """ Returns positive number if packaga yum-rhn-plugin is installed, otherwise it return 0 """
+ ts = rpm.TransactionSet()
+ headers = ts.dbMatch('providename', 'yum-rhn-plugin')
+ return headers.count()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 7e0c63d..ab06a88 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -82,7 +82,18 @@ class ReviewLog:
def __init__(self):
self._text = gtk.TextBuffer()
self._boldTag = self._text.create_tag(weight=700)
-
+
+ def prependBoldText(self, text):
+ """Adds a blob of bolded text to the beggining specified section. Adds a newline
+ after the text.
+ """
+ self.prependText(text)
+ # Make it bold
+ startOfText = self._text.get_start_iter()
+ endOfText = self._text.get_start_iter()
+ endOfText.forward_chars(len(text) +1 )
+ self._text.apply_tag(self._boldTag, startOfText, endOfText)
+
def addBoldText(self, text):
"""Adds a blob of bolded text to the specified section. Adds a newline
after the text.
@@ -94,7 +105,14 @@ class ReviewLog:
startOfText.backward_chars(len(text) +1 )
end = self._text.get_end_iter()
self._text.apply_tag(self._boldTag, startOfText, end)
-
+
+ def prependText(self, text):
+ """ Insert a blob of text at the beggining of section. Adds a newline
+ after the text.
+ """
+ start = self._text.get_start_iter()
+ self._text.insert(start, text + '\n')
+
def addText(self, text):
"""Adds a blob of text to the specified section. Adds a newline after
the text.
@@ -114,7 +132,28 @@ class ReviewLog:
keys = ', '.join(keyName)
self.addText(rhnreg_constants.ACTIVATION_KEY % (keys))
self.addText('') # adds newline
-
+
+ def yum_plugin_warning(self):
+ """ Add to review screen warning that yum-rhn-plugin is not installed """
+ # prepending -> reverse order
+ self.prependText('') # adds newline
+ self.prependText(rhnreg_constants.YUM_PLUGIN_WARNING)
+ self.prependBoldText(_("Warning"))
+
+ def yum_plugin_conf_changed(self):
+ """ Add to review screen warning that yum-rhn-plugin config file has been changed """
+ # prepending -> reverse order
+ self.prependText('') # adds newline
+ self.prependText(rhnreg_constants.YUM_PLUGIN_CONF_CHANGED)
+ self.prependBoldText(_("Notice"))
+
+ def yum_plugin_conf_error(self):
+ """ Add to review screen warning that yum-rhn-plugin config file can not be open """
+ # prepending -> reverse order
+ self.prependText('') # adds newline
+ self.prependText(rhnreg_constants.YUM_PLUGIN_CONF_ERROR)
+ self.prependBoldText(_("Warning"))
+
def channels(self, subscribedChannels, failedChannels):
self.addBoldText(rhnreg_constants.CHANNELS_TITLE)
if len(subscribedChannels) > 0:
@@ -836,6 +875,21 @@ class CreateProfilePage:
# no channels subscribe
self.noChannels = 1
+ # enable yum-rhn-plugin
+ try:
+ if rhnreg.YumRHNPluginPackagePresent():
+ if rhnreg.YumRHNPluginConfPresent():
+ if not rhnreg.YumRhnPluginEnabled():
+ rhnreg.enableYumRhnPlugin()
+ reviewLog.yum_plugin_conf_changed()
+ else:
+ rhnreg.createDefaultYumRHNPluginConf()
+ reviewLog.yum_plugin_conf_changed()
+ else:
+ reviewLog.yum_plugin_warning()
+ except IOError, e:
+ errorWindow(_("Could not open /etc/yum/pluginconf.d/rhnplugin.conf\nyum-rhn-plugin is not enable.\n") + e.errmsg)
+ reviewLog.yum_plugin_conf_error()
rhnreg.spawnRhnCheckForUI()
pwin.setProgress(6,6)
pwin.hide()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index c8f97d9..1199af3 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -176,6 +176,12 @@ CHANNELS_HOSTED_WARNING = _("Warning: If an installed product on this system "
"product. See Kbase article 11313 "
"for more details. "
"(http://kbase.redhat.com/faq/docs/DOC-11313)")
+YUM_PLUGIN_WARNING = _("Warning: yum-rhn-plugin is not present, could not enable it.\n"
+ "Automatic updates will not work.")
+YUM_PLUGIN_CONF_CHANGED = _("Note: yum-rhn-plugin has been enabled.")
+YUM_PLUGIN_CONF_ERROR = _("Warning: An error occurred during enabling yum-rhn-plugin.\n"
+ "yum-rhn-plugin is not enabled.\n"
+ "Automatic updates will not work.")
FAILED_CHANNELS = _("You were unable to be subscribed to the following "
"software channels because there were insufficient "
"subscriptions available in your account:")
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index 42a6f95..2ff68e3 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -45,6 +45,12 @@ def FatalErrorWindow(screen, errmsg):
[OK])
screen.finish()
sys.exit(1)
+
+def WarningWindow(screen, errmsg):
+ snack.ButtonChoiceWindow(screen, WARNING, "%s" % errmsg,
+ [OK])
+ screen.finish()
+
def ConfirmQuitWindow(screen):
button = snack.ButtonChoiceWindow(screen, CONFIRM_QUIT,
@@ -905,7 +911,23 @@ class SendingWindow:
except up2dateErrors.InsuffMgmntEntsError, e:
FatalErrorWindow(self.screen, e)
- rhnreg.spawnRhnCheckForUI()
+ # enable yum-rhn-plugin
+ try:
+ if rhnreg.YumRHNPluginPackagePresent():
+ if rhnreg.YumRHNPluginConfPresent():
+ if not rhnreg.YumRhnPluginEnabled():
+ rhnreg.enableYumRhnPlugin()
+ self.tui.yum_plugin_conf_changed = 1
+ else:
+ rhnreg.createDefaultYumRHNPluginConf()
+ self.tui.yum_plugin_conf_changed = 1
+ else:
+ self.tui.yum_plugin_present = 0
+ except IOError, e:
+ WarningWindow(self.screen, _("Could not open /etc/yum/pluginconf.d/rhnplugin.conf\nyum-rhn-plugin is not enabled.\n") + e.errmsg)
+ self.tui.yum_plugin_conf_error = 1
+
+ rhnreg.spawnRhnCheckForUI()
self.setScale(4, 4)
# Pop the pwin (Progress bar window)
@@ -969,9 +991,17 @@ class ReviewWindow:
size = snack._snack.size()
toplevel = snack.GridForm(screen, REVIEW_WINDOW, 1, 2)
-
+ review_window_text = ''
+
+ if not self.tui.yum_plugin_present:
+ review_window_text += YUM_PLUGIN_WARNING + "\n\n"
+ if self.tui.yum_plugin_conf_error:
+ review_window_text += YUM_PLUGIN_CONF_ERROR + "\n\n"
+ if self.tui.yum_plugin_conf_changed:
+ review_window_text += YUM_PLUGIN_CONF_CHANGED + "\n\n"
+
# Build up the review_window_text based on the data in self.reg_info
- review_window_text = REVIEW_WINDOW_PROMPT + "\n\n"
+ review_window_text += REVIEW_WINDOW_PROMPT + "\n\n"
# Create and add the text for what channels the system was
# subscribed to.
@@ -1039,7 +1069,11 @@ class ReviewWindow:
button = self.bb.buttonPressed(result)
if result == "F12":
- return "next"
+ button = "next"
+ if not self.tui.yum_plugin_present:
+ button = "exit"
+ if self.tui.yum_plugin_conf_error:
+ button = "exit"
return button
@@ -1125,6 +1159,9 @@ class Tui:
self.includePackages = 0
self.packageList = []
self.selectedPackages = []
+ self.yum_plugin_present = 1
+ self.yum_plugin_conf_error = 0
+ self.yum_plugin_conf_changed = 0
def run(self):
log.log_debug("Running %s" % self.__class__.__name__)
diff --git a/client/rhel/yum-rhn-plugin/rhnplugin.conf b/client/rhel/yum-rhn-plugin/rhnplugin.conf
index d50adca..076aa38 100644
--- a/client/rhel/yum-rhn-plugin/rhnplugin.conf
+++ b/client/rhel/yum-rhn-plugin/rhnplugin.conf
@@ -1,5 +1,5 @@
[main]
-enabled = 1
+enabled = 0
gpgcheck = 1
# You can specify options per channel, e.g.:
13 years, 4 months
Changes to 'refs/tags/spacewalk-backend-1.3.56-1'
by Milan Zazrivec
Tag 'spacewalk-backend-1.3.56-1' created by Milan Zazrivec <mzazrivec(a)redhat.com> at 2011-02-04 10:14 +0000
Tagging package [spacewalk-backend] version [1.3.56-1] in directory [backend/].
Changes since spacewalk-backend-1.3.55-1:
Milan Zazrivec (2):
590608 - nullify jabber_ids from previous registrations
Automatic commit of package [spacewalk-backend] release [1.3.56-1].
---
backend/server/rhnServer/server_lib.py | 14 ++++++++++++--
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
---
13 years, 4 months
Branch 'SPACEWALK-1.3' - backend/spacewalk-backend.spec rel-eng/packages
by Milan Zazrivec
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 8bea6cf4d829b4a7f247ee182506f5f42a2a3aed
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Fri Feb 4 11:14:10 2011 +0100
Automatic commit of package [spacewalk-backend] release [1.3.56-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index ee337e8..e179216 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.55
+Version: 1.3.56
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -684,6 +684,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Feb 04 2011 Milan Zazrivec <mzazrivec(a)redhat.com> 1.3.56-1
+- 590608 - nullify jabber_ids from previous registrations
+
* Fri Feb 04 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.3.55-1
- fixed postgresql failure on RHEL6
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 71a16a1..1017618 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.55-1 backend/
+1.3.56-1 backend/
13 years, 4 months
Branch 'SPACEWALK-1.3' - backend/server
by Milan Zazrivec
backend/server/rhnServer/server_lib.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit 62e63a633b29d169c6c4524be248bfdf01b2e2b1
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Thu Feb 3 18:13:36 2011 +0100
590608 - nullify jabber_ids from previous registrations
This fix is to ensure push functionality will be functional after
system's re-registration.
Couple of things adding to the problem:
* after system re-registration, systemid changes, jabber_id stays
* rhnPushClient table with multiple rows with identical jabber_id
and different server_id
* osa-dispatcher tries to find shared key for given jabber_id, backend
simply returns the first row fetched (now with an invalid shared key)
* signatures computed by osad and osa-dispatcher do not match -> osad
won't do anything
* deleting the older servers in webui won't help
(cherry picked from commit 5d7cbc0e2ac44b69c6dd8ed652bd85f572e95ef9)
diff --git a/backend/server/rhnServer/server_lib.py b/backend/server/rhnServer/server_lib.py
index fa96a61..e47df37 100644
--- a/backend/server/rhnServer/server_lib.py
+++ b/backend/server/rhnServer/server_lib.py
@@ -349,6 +349,13 @@ def update_push_client_registration(server_id):
# Autonomous transaction, so no need to commit
return timestamp, client_name, shared_key
+_query_delete_duplicate_client_jids = rhnSQL.Statement("""
+ update rhnPushClient
+ set jabber_id = null
+ where jabber_id = :jid and
+ server_id <> :server_id
+""")
+
_query_update_push_client_jid = rhnSQL.Statement("""
update rhnPushClient
set jabber_id = :jid,
@@ -356,9 +363,12 @@ _query_update_push_client_jid = rhnSQL.Statement("""
last_ping_time = NULL
where server_id = :server_id
""")
+
def update_push_client_jid(server_id, jid):
- h = rhnSQL.prepare(_query_update_push_client_jid)
- h.execute(server_id=server_id, jid=jid)
+ h1 = rhnSQL.prepare(_query_delete_duplicate_client_jids)
+ h1.execute(server_id=server_id, jid=jid)
+ h2 = rhnSQL.prepare(_query_update_push_client_jid)
+ h2.execute(server_id=server_id, jid=jid)
rhnSQL.commit()
return jid
13 years, 4 months