backend/satellite_tools/satsync.py | 27 ++++----
utils/spacewalk-common-channels.ini | 116 +++++++++++++++++++++++++++++++++++-
2 files changed, 128 insertions(+), 15 deletions(-)
New commits:
commit 513be7ad9c8f73630582cef905ca1b7a9052a3df
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 29 11:50:48 2011 +0200
696970 - disabled localization
backend logging subclasses aren't prepared for full localization yet
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 040086f..59d167f 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -25,7 +25,6 @@ import string
import time
import types
import exceptions
-import locale
from optparse import Option, OptionParser
from rhn.connections import idn_ascii_to_pune
@@ -157,10 +156,6 @@ class Runner:
# let's time the whole process
timeStart = time.time()
- try:
- locale.setlocale(locale.LC_ALL, '')
- except locale.Error: # unsupported locale setting - just ignore it
- pass
actionDict, channels = processCommandline()
#5/24/05 wregglej - 156079 turn off an step's dependent steps if it's
turned off.
commit db5df50dd31a51d147073ee9f104f8a8e7ec3e37
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 28 11:57:55 2011 +0200
696970 - unified time printing via formatDateTime()
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 257f0f8..040086f 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -249,8 +249,9 @@ class Runner:
Begin time: %s
End time: %s
Elapsed: %s
- """) % (time.strftime ("%c",
time.localtime(timeStart)),
- time.strftime ("%c", time.localtime(timeEnd)), delta_str),
+ """) % (formatDateTime(dt=time.localtime(timeStart)),
+ formatDateTime(dt=time.localtime(timeEnd)),
+ delta_str),
cleanYN=1)
# mail out that log if appropriate
@@ -690,10 +691,6 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
log(1, _("Channel data complete"))
- def _formatDateTime(self, datestring):
- """ Format the date time using your locale settings. This assume
that your setlocale has been alread called. """
- return time.strftime ("%c", time.strptime(datestring,
'%Y%m%d%H%M%S'))
-
def _formatChannelExportType(self, channel):
"""returns pretty formated text with type of channel
export"""
if 'export-type' not in channel or channel['export-type'] is
None:
@@ -709,9 +706,12 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
else:
end_date = ''
if end_date and not start_date:
- return _("%10s import from %s") % (export_type,
self._formatDateTime(end_date))
+ return _("%10s import from %s") % (export_type,
+ formatDateTime(end_date))
elif end_date and start_date:
- return _("%10s import from %s - %s") % (export_type,
self._formatDateTime(start_date), self._formatDateTime(end_date))
+ return _("%10s import from %s - %s") % (export_type,
+ formatDateTime(start_date),
+ formatDateTime(end_date))
else:
return _("%10s") % export_type
@@ -2277,6 +2277,12 @@ def processCommandline():
# return the dictionary of actions, channels
return actionDict, channels
+def formatDateTime(dtstring=None, dt=None):
+ """ Format the date time using your locale settings. This assume that
your setlocale has been alread called. """
+ if not dt:
+ dt = time.strptime(dtstring, '%Y%m%d%H%M%S')
+ return time.strftime("%c", dt)
+
if __name__ == '__main__':
sys.stderr.write("!!! running this directly is advisable *ONLY* for
testing"
commit a39b67afaa28231434b22393f09563886e77c335
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 28 11:49:00 2011 +0200
696970 - %%c is the preferred date/time representation for the current locale
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 30dc29e..257f0f8 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -249,8 +249,8 @@ class Runner:
Begin time: %s
End time: %s
Elapsed: %s
- """) % (time.strftime (locale.nl_langinfo(locale.D_T_FMT),
time.localtime(timeStart)),
- time.strftime (locale.nl_langinfo(locale.D_T_FMT),
time.localtime(timeEnd)), delta_str),
+ """) % (time.strftime ("%c",
time.localtime(timeStart)),
+ time.strftime ("%c", time.localtime(timeEnd)), delta_str),
cleanYN=1)
# mail out that log if appropriate
@@ -692,7 +692,7 @@ Please contact your RHN representative""") %
(generation, sat_cert.generation))
def _formatDateTime(self, datestring):
""" Format the date time using your locale settings. This assume
that your setlocale has been alread called. """
- return time.strftime (locale.nl_langinfo(locale.D_T_FMT),
time.strptime(datestring, '%Y%m%d%H%M%S'))
+ return time.strftime ("%c", time.strptime(datestring,
'%Y%m%d%H%M%S'))
def _formatChannelExportType(self, channel):
"""returns pretty formated text with type of channel
export"""
commit 23fc724aa5bcd8ef5898ac6c2379eaa71f0830cc
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 28 11:46:47 2011 +0200
696970 - locale must be initialized by calling setlocale(LC_ALL, '')
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index e230a57..30dc29e 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -158,7 +158,7 @@ class Runner:
timeStart = time.time()
try:
- locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
+ locale.setlocale(locale.LC_ALL, '')
except locale.Error: # unsupported locale setting - just ignore it
pass
actionDict, channels = processCommandline()
commit 0486129ee2491c3c9aaa98e6a630f7da479ef97d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Apr 26 14:21:32 2011 +0200
fixed base channel for spacewalk on F14
diff --git a/utils/spacewalk-common-channels.ini b/utils/spacewalk-common-channels.ini
index d0b5559..0d9a010 100644
--- a/utils/spacewalk-common-channels.ini
+++ b/utils/spacewalk-common-channels.ini
@@ -254,7 +254,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/1.3/RHEL/5/%(arch)s/
[spacewalk13-server-fedora14]
name = Spacewalk Server 1.3 for %(base_channel_name)s
archs = i386, x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
@@ -282,7 +282,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/1.3-client/RHEL/5/%(arch)s/
[spacewalk13-client-fedora14]
name = Spacewalk Client 1.3 for %(base_channel_name)s
archs = i386, x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
@@ -384,7 +384,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/1.4/RHEL/5/%(arch)s/
[spacewalk14-server-fedora14]
name = Spacewalk Server 1.4 for %(base_channel_name)s
archs = x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
@@ -412,7 +412,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/1.4-client/RHEL/5/%(arch)s/
[spacewalk14-client-fedora14]
name = Spacewalk Client 1.4 for %(base_channel_name)s
archs = i386, x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
@@ -440,7 +440,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/nightly/RHEL/5/%(arch)s/
[spacewalk-nightly-server-fedora14]
name = Spacewalk Server (N) for %(base_channel_name)s
archs = x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
@@ -468,7 +468,7 @@ yumrepo_url =
http://spacewalk.redhat.com/yum/nightly-client/RHEL/5/%(arch)s/
[spacewalk-nightly-client-fedora14]
name = Spacewalk Client (N) for %(base_channel_name)s
archs = i386, x86_64
-base_channels = fedora12-%(arch)s
+base_channels = fedora14-%(arch)s
gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
commit b285114a58779b0a27ec457bd375e7cf0e9172f3
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Apr 26 13:38:52 2011 +0200
added spacewalk nightly entries
diff --git a/utils/spacewalk-common-channels.ini b/utils/spacewalk-common-channels.ini
index 35c7241..d0b5559 100644
--- a/utils/spacewalk-common-channels.ini
+++ b/utils/spacewalk-common-channels.ini
@@ -426,3 +426,59 @@ gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
yumrepo_url =
http://spacewalk.redhat.com/yum/1.4-client/Fedora/13/%(arch)s/
+
+
+[spacewalk-nightly-server-centos5]
+name = Spacewalk Server (N) for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = centos5-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly/RHEL/5/%(arch)s/
+
+[spacewalk-nightly-server-fedora14]
+name = Spacewalk Server (N) for %(base_channel_name)s
+archs = x86_64
+base_channels = fedora12-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly/Fedora/14/%(arch)s/
+
+[spacewalk-nightly-server-fedora13]
+name = Spacewalk Server (N) for %(base_channel_name)s
+archs = x86_64
+base_channels = fedora13-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly/Fedora/13/%(arch)s/
+
+
+[spacewalk-nightly-client-centos5]
+name = Spacewalk Client (N) for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = centos5-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly-client/RHEL/5/%(arch)s/
+
+[spacewalk-nightly-client-fedora14]
+name = Spacewalk Client (N) for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = fedora12-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly-client/Fedora/14/%(arch)s/
+
+[spacewalk-nightly-client-fedora13]
+name = Spacewalk Client (N) for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = fedora13-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/nightly-client/Fedora/13/%(arch)s/
commit bd24960a348a4d39c59b0754fbb60c44df009491
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Apr 26 13:38:52 2011 +0200
added spacewalk 1.4 entries
diff --git a/utils/spacewalk-common-channels.ini b/utils/spacewalk-common-channels.ini
index 676aa0d..35c7241 100644
--- a/utils/spacewalk-common-channels.ini
+++ b/utils/spacewalk-common-channels.ini
@@ -370,3 +370,59 @@ gpgkey_url = %(_spacewalk_gpgkey_url)s
gpgkey_id = %(_spacewalk_gpgkey_id)s
gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
yumrepo_url =
http://spacewalk.redhat.com/yum/1.2-client/Fedora/14/%(arch)s/
+
+
+[spacewalk14-server-centos5]
+name = Spacewalk Server 1.4 for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = centos5-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4/RHEL/5/%(arch)s/
+
+[spacewalk14-server-fedora14]
+name = Spacewalk Server 1.4 for %(base_channel_name)s
+archs = x86_64
+base_channels = fedora12-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4/Fedora/14/%(arch)s/
+
+[spacewalk14-server-fedora13]
+name = Spacewalk Server 1.4 for %(base_channel_name)s
+archs = x86_64
+base_channels = fedora13-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4/Fedora/13/%(arch)s/
+
+
+[spacewalk14-client-centos5]
+name = Spacewalk Client 1.4 for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = centos5-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4-client/RHEL/5/%(arch)s/
+
+[spacewalk14-client-fedora14]
+name = Spacewalk Client 1.4 for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = fedora12-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4-client/Fedora/14/%(arch)s/
+
+[spacewalk14-client-fedora13]
+name = Spacewalk Client 1.4 for %(base_channel_name)s
+archs = i386, x86_64
+base_channels = fedora13-%(arch)s
+gpgkey_url = %(_spacewalk_gpgkey_url)s
+gpgkey_id = %(_spacewalk_gpgkey_id)s
+gpgkey_fingerprint = %(_spacewalk_gpgkey_fingerprint)s
+yumrepo_url =
http://spacewalk.redhat.com/yum/1.4-client/Fedora/13/%(arch)s/