backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 3877c716d8a695ff4080c2b40dc927e2e4a9c4e8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 17 15:14:49 2011 +0100
Automatic commit of package [spacewalk-backend] release [1.3.41-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 5ec5f2b..1b7f611 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.40
+Version: 1.3.41
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -683,6 +683,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Jan 17 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.3.41-1
+- rpmbuid failure
+
* Mon Jan 17 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.3.40-1
- 650165 - _ChannelDumper should also understand use_rhn_date
- converted comments to docstrings
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 16bf262..68c23bb 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.40-1 backend/
+1.3.41-1 backend/
13 years, 5 months
backend/satellite_tools
by Michael Mraka
backend/satellite_tools/exporter/exportLib.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 0023d71028c638df9fdbe16609020abdf40fa443
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 17 15:10:16 2011 +0100
fixed typo
diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 3103835..a3cb263 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -386,7 +386,7 @@ class _ChannelDumper(BaseRowDumper):
def _get_errata_ids(self):
return self._get_ids(self._query__get_errata_ids_by_limits,
- self._query__get_errata_ids_by_rhnlimits
+ self._query__get_errata_ids_by_rhnlimits,
self._query__get_errata_ids)
_query_get_kickstartable_trees = rhnSQL.Statement("""
13 years, 5 months
Changes to 'refs/tags/osad-5.9.49-1'
by Jan Pazdziora
Tag 'osad-5.9.49-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-01-17 13:48 +0000
Tagging package [osad] version [5.9.49-1] in directory [client/tools/osad/].
Changes since spacewalk-backend-1.3.40-1:
Jan Pazdziora (3):
Silence diagnostics which was causing AVC denials.
Silence InstantClient 11g-related AVCs in osa-dispatcher.
Automatic commit of package [osad] release [5.9.49-1].
---
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te | 3 +++
client/tools/osad/osad.spec | 6 +++++-
client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora | 1 +
rel-eng/packages/osad | 2 +-
4 files changed, 10 insertions(+), 2 deletions(-)
---
13 years, 5 months
client/tools rel-eng/packages
by Jan Pazdziora
client/tools/osad/osad.spec | 6 +++++-
rel-eng/packages/osad | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 1b36d22454e688ee85643932993c105d76f7a338
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Jan 17 14:48:28 2011 +0100
Automatic commit of package [osad] release [5.9.49-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 85293de..ac060e6 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.48
+Version: 5.9.49
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -246,6 +246,10 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Mon Jan 17 2011 Jan Pazdziora 5.9.49-1
+- Silence InstantClient 11g-related AVCs in osa-dispatcher.
+- Silence diagnostics which was causing AVC denials.
+
* Tue Dec 21 2010 Jan Pazdziora 5.9.48-1
- SQL changes for PostgreSQL support.
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 5357cab..41c5f72 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.48-1 client/tools/osad/
+5.9.49-1 client/tools/osad/
13 years, 5 months
client/tools
by Jan Pazdziora
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 17701442abdbd239ce69f03ccd71f72ea357c57b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Jan 17 14:36:39 2011 +0100
Silence InstantClient 11g-related AVCs in osa-dispatcher.
avc: denied { search } for pid=7819 comm="osa-dispatcher" scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=dir
avc: denied { read } for pid=7819 comm="osa-dispatcher" scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:sysctl_kernel_t:s0 tclass=file
avc: denied { search } for pid=7819 comm="osa-dispatcher" name="/" dev=sysfs ino=1 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir
avc: denied { read } for pid=7819 comm="osa-dispatcher" name="node" dev=sysfs ino=121 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir
avc: denied { open } for pid=7819 comm="osa-dispatcher" name="node" dev=sysfs ino=121 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
index 9c1ce83..91e154e 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
@@ -90,3 +90,6 @@ allow osa_dispatcher_t oracle_port_t:tcp_socket name_connect;
')
postgresql_stream_connect(osa_dispatcher_t)
+
+kernel_read_kernel_sysctls(osa_dispatcher_t)
+dev_list_sysfs(osa_dispatcher_t)
13 years, 5 months
client/tools
by Jan Pazdziora
client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 256f38c43c50709c0981644f24ea590c050284f4
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Jan 17 14:33:03 2011 +0100
Silence diagnostics which was causing AVC denials.
Addressing
avc: denied { search } for pid=7367 comm="osa-dispatcher" name="oradiag_root" dev=dm-0 ino=1709872 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:oracle_tmp_t:s0 tclass=dir
avc: denied { setattr } for pid=7367 comm="osa-dispatcher" name="diag" dev=dm-0 ino=1709873 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:oracle_tmp_t:s0 tclass=dir
avc: denied { getattr } for pid=7367 comm="osa-dispatcher" path="/var/tmp/oradiag_root/diag/clients/user_root" dev=dm-0 ino=1709875 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:oracle_tmp_t:s0 tclass=dir
and
avc: denied { write } for pid=7502 comm="osa-dispatcher" name="tmp" dev=dm-0 ino=1703964 scontext=unconfined_u:system_r:osa_dispatcher_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
index 13206ad..fc7e0df 100644
--- a/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
+++ b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
@@ -1,3 +1,4 @@
log_directory_client = /var/log/rhn/oracle/osa-dispatcher
+diag_adr_enabled = off
13 years, 5 months
Changes to 'refs/tags/spacewalk-backend-1.3.40-1'
by Michael Mraka
Tag 'spacewalk-backend-1.3.40-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2011-01-17 13:06 +0000
Tagging package [spacewalk-backend] version [1.3.40-1] in directory [backend/].
Changes since yum-rhn-plugin-1.3.3-1:
Michael Mraka (2):
650165 - _ChannelDumper should also understand use_rhn_date
Automatic commit of package [spacewalk-backend] release [1.3.40-1].
Miroslav Suchý (1):
651792 - list all available child channels related to system
---
backend/satellite_tools/disk_dumper/dumper.py | 9 +-
backend/satellite_tools/disk_dumper/iss.py | 2
backend/satellite_tools/exporter/exportLib.py | 43 ++++++++------
backend/spacewalk-backend.spec | 8 ++
client/rhel/rhn-client-tools/man/en/spacewalk-channel.8 | 3
client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 28 ++++++++-
client/rhel/rhn-client-tools/src/up2date_client/config.py | 12 +++
rel-eng/packages/spacewalk-backend | 2
8 files changed, 83 insertions(+), 24 deletions(-)
---
13 years, 5 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 8 +++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 05ff4051ae9756c608c8efc2685eb83ff0f55edf
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 17 14:06:23 2011 +0100
Automatic commit of package [spacewalk-backend] release [1.3.40-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 03e82e4..5ec5f2b 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.39
+Version: 1.3.40
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -683,6 +683,12 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Jan 17 2011 Michael Mraka <michael.mraka(a)redhat.com> 1.3.40-1
+- 650165 - _ChannelDumper should also understand use_rhn_date
+- converted comments to docstrings
+- do not check throttle within each request
+- fixed whitespace
+
* Tue Jan 11 2011 Jan Pazdziora 1.3.39-1
- Use spacewalk-sql in satwho and satpasswd, thus making it work on PostgreSQL.
- code cleanup: there is no proxy < 4.1 in real word (msuchy(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 0addeb4..16bf262 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.3.39-1 backend/
+1.3.40-1 backend/
13 years, 5 months
backend/satellite_tools
by Michael Mraka
backend/satellite_tools/disk_dumper/dumper.py | 9 +++--
backend/satellite_tools/disk_dumper/iss.py | 2 -
backend/satellite_tools/exporter/exportLib.py | 43 ++++++++++++++++----------
3 files changed, 33 insertions(+), 21 deletions(-)
New commits:
commit ab481c31b699933cd186f9b68f5a0e4781a2b100
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Jan 17 11:38:33 2011 +0100
650165 - _ChannelDumper should also understand use_rhn_date
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index fdde6d8..f74e4c9 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -192,12 +192,12 @@ class XML_Dumper:
data_iterator=h, null_max_members=0)
return 0
- def dump_channels(self, channel_labels=None, start_date=None, end_date=None):
+ def dump_channels(self, channel_labels=None, start_date=None, end_date=None, use_rhn_date=True):
log_debug(2)
#channels = self._validate_channels(channel_labels=channel_labels)
self._write_dump(ChannelsDumper,
- channels=channel_labels, start_date=start_date, end_date=end_date)
+ channels=channel_labels, start_date=start_date, end_date=end_date, use_rhn_date=use_rhn_date)
return 0
def _send_headers(self, error=0, init_compressed_stream=1):
@@ -671,15 +671,16 @@ class ChannelsDumper(exportLib.ChannelsDumper):
and c.channel_arch_id = ca.id
""")
- def __init__(self, writer, channels=[], start_date=None, end_date=None):
+ def __init__(self, writer, channels=[], start_date=None, end_date=None, use_rhn_date=True):
exportLib.ChannelsDumper.__init__(self, writer, channels)
self.start_date = start_date
self.end_date = end_date
+ self.use_rhn_date = use_rhn_date
def dump_subelement(self, data):
log_debug(6, data)
#return exportLib.ChannelsDumper.dump_subelement(self, data)
- c = exportLib._ChannelDumper(self._writer, data, self.start_date, self.end_date)
+ c = exportLib._ChannelDumper(self._writer, data, self.start_date, self.end_date, self.use_rhn_date)
c.dump()
def set_iterator(self):
diff --git a/backend/satellite_tools/disk_dumper/iss.py b/backend/satellite_tools/disk_dumper/iss.py
index 827e9ed..0203218 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -549,7 +549,7 @@ class Dumper(dumper.XML_Dumper):
pb.printAll(1)
for channel in self.channel_ids:
self.set_filename(self.fm.getChannelsFile(channel['label']))
- dumper.XML_Dumper.dump_channels(self, [channel], self.start_date, self.end_date)
+ dumper.XML_Dumper.dump_channels(self, [channel], self.start_date, self.end_date, self.use_rhn_date)
log2email(4, "Channel: %s" % channel['label'])
log2email(5, "Channel exported to %s" % self.fm.getChannelsFile(channel['label']))
diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 9fc40ab..3103835 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -201,10 +201,11 @@ class SatelliteDumper(BaseDumper):
class _ChannelDumper(BaseRowDumper):
tag_name = 'rhn-channel'
- def __init__(self, writer, row, start_date=None, end_date=None):
+ def __init__(self, writer, row, start_date=None, end_date=None, use_rhn_date=True):
BaseRowDumper.__init__(self, writer, row)
self.start_date = start_date
self.end_date = end_date
+ self.use_rhn_date = use_rhn_date
def set_attributes(self):
channel_id = self._row['id']
@@ -307,27 +308,35 @@ class _ChannelDumper(BaseRowDumper):
_query_get_package_ids_by_date_limits = rhnSQL.Statement("""
select package_id as id
+ from rhnChannelPackage rcp
+ where rcp.channel_id = :channel_id
+ and rcp.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ and rcp.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ """)
+
+ _query_get_package_ids_by_rhndate_limits = rhnSQL.Statement("""
+ select package_id as id
from rhnPackage rp, rhnChannelPackage rcp
where rcp.channel_id = :channel_id
- and rcp.package_id = rp.id
- and (rcp.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- or rp.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- )
- and (rcp.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
- or rp.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
- )
+ and rcp.package_id = rp.id
+ and rp.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ and rp.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
""")
# Things that can be overwriten in subclasses
def _get_package_ids(self):
return self._get_ids(self._query_get_package_ids_by_date_limits,
+ self._query_get_package_ids_by_rhndate_limits,
self._query_get_package_ids)
- def _get_ids(self, query_with_limit, query_no_limits):
+ def _get_ids(self, query_with_limit, query_with_rhnlimit, query_no_limits):
query_args = {'channel_id': self._row['id']}
if self.start_date:
- query = query_with_limit
+ if self.use_rhn_date:
+ query = query_with_rhnlimit
+ else:
+ query = query_with_limit
query_args.update({'lower_limit': self.start_date,
'upper_limit': self.end_date})
else:
@@ -365,17 +374,19 @@ class _ChannelDumper(BaseRowDumper):
_query__get_errata_ids_by_limits = rhnSQL.Statement("""
%s
- and (ce.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- or e.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- )
- and (ce.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
- or e.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
- )
+ and ce.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ and ce.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
""" % _query__get_errata_ids)
+ _query__get_errata_ids_by_rhnlimits = rhnSQL.Statement("""
+ %s
+ and e.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ and e.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ """ % _query__get_errata_ids)
def _get_errata_ids(self):
return self._get_ids(self._query__get_errata_ids_by_limits,
+ self._query__get_errata_ids_by_rhnlimits
self._query__get_errata_ids)
_query_get_kickstartable_trees = rhnSQL.Statement("""
13 years, 5 months
client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/man/en/spacewalk-channel.8 | 3 +
client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 28 +++++++++++++-
client/rhel/rhn-client-tools/src/up2date_client/config.py | 12 ++++++
3 files changed, 42 insertions(+), 1 deletion(-)
New commits:
commit b9514bdb221d9635f58c188d3408146f1058f6ba
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jan 14 17:03:07 2011 +0100
651792 - list all available child channels related to system
diff --git a/client/rhel/rhn-client-tools/man/en/spacewalk-channel.8 b/client/rhel/rhn-client-tools/man/en/spacewalk-channel.8
index 4710fd1..5c0edc6 100644
--- a/client/rhel/rhn-client-tools/man/en/spacewalk-channel.8
+++ b/client/rhel/rhn-client-tools/man/en/spacewalk-channel.8
@@ -34,6 +34,9 @@ specified channels via the command line. A visit to the Red Hat Network
.IP "\fB-l, --list\fP"
Print a list of channel(s) that you are currently subscribed to.
.br
+.IP "\fB-L, --available-channels\fP"
+Print a list of all available child channels.
+.br
.IP "\fB-a, --add\fP"
You are subscribing system to given channel(s). You have to specify --user and --password.
.br
diff --git a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
index e76730f..a642718 100644
--- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
+++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
@@ -13,10 +13,14 @@
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.
#
+import getpass
import os
+import re
import socket
import sys
-import getpass
+import urlparse
+import xmlrpclib
+from rhn import rpclib
from optparse import Option, OptionParser
@@ -56,6 +60,8 @@ def processCommandline():
help=_('unsubscribe from channel')),
Option('-l', '--list', action='store_true',
help=_('list channels')),
+ Option('-L', '--available-channels', action='store_true',
+ help=_('list all available child channels')),
Option('-v', '--verbose', action='store_true',
help=_('verbose output')),
Option('-u', '--user', action='store',
@@ -76,6 +82,22 @@ def processCommandline():
if not OPTIONS.password and not OPTIONS.list:
OPTIONS.password = getpass.getpass()
+def get_available_channels(user, password):
+ """ return list of available child channels """
+ cfg = config.initUp2dateConfig()
+ satellite_url = config.getServerlURL()[0]
+ parts = urlparse.urlsplit(satellite_url)
+ satellite_url = urlparse.SplitResult(parts.scheme, parts.netloc, '/rpc/api',
+ parts.query, parts.fragment).geturl()
+
+ client = xmlrpclib.Server(satellite_url, verbose=0)
+ key = client.auth.login(user, password)
+ system_id = re.sub('^ID-', '', rpclib.xmlrpclib.loads(up2dateAuth.getSystemId())[0][0]['system_id'])
+ result = []
+ for channel in client.system.listChildChannels(key, int(system_id)):
+ result.extend([channel['LABEL']])
+ return result
+
def need_channel(channel):
""" die gracefuly if channel is empty """
if not channel:
@@ -99,6 +121,10 @@ def main():
systemExit(1, _('This system is not associated with any channel.'))
channels.sort()
print '\n'.join(channels)
+ elif OPTIONS.available-channels:
+ channels = get_available_channels(OPTIONS.user, OPTIONS.password)
+ channels.sort()
+ print '\n'.join(channels)
else:
systemExit(3, _("ERROR: you may want to specify --add, --remove or --list"))
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/config.py b/client/rhel/rhn-client-tools/src/up2date_client/config.py
index 99ec8ec..44d24e2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/config.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/config.py
@@ -280,6 +280,18 @@ def getProxySetting():
return proxy
+def getServerlURL():
+ """ return list of serverURL from config
+ Note: in config may be one value or more values, but this
+ function always return list
+ """
+ cfg = initUp2dateConfig()
+ # serverURL may be a list in the config file, so by default, grab the
+ # first element.
+ if type(cfg['serverURL']) == type([]):
+ return cfg['serverURL']
+ else:
+ return [cfg['serverURL']]
def initUp2dateConfig(cfg_file = "/etc/sysconfig/rhn/up2date"):
"""This function is the right way to get at the up2date config."""
13 years, 5 months