8 commits - monitoring/nocpulse-common monitoring/NPalert monitoring/PerlModules
by Michael Mraka
monitoring/NPalert/NPalert.spec | 3 ++
monitoring/NPalert/NotificationDB.pm | 15 ++++---------
monitoring/NPalert/httpd/cgi-bin/redirmgr.cgi | 1
monitoring/NPalert/scripts/generate-config | 7 ++++--
monitoring/NPalert/scripts/notif | 1
monitoring/NPalert/scripts/notif-escalator | 1
monitoring/NPalert/scripts/notif-launcher | 1
monitoring/NPalert/scripts/notifier | 1
monitoring/PerlModules/NP/Gritch/Gritch.pm | 1
monitoring/PerlModules/NP/Gritch/perl-NOCpulse-Gritch.spec | 1
monitoring/nocpulse-common/nocpulse-common.spec | 2 +
11 files changed, 16 insertions(+), 18 deletions(-)
New commits:
commit e062e0bcee69781b420c32dfae89323911880ed3
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 24 16:54:45 2011 +0100
493028 - ack_enqueuer.pl must be linked from /etc/smrsh
to properly work in sendmail environment
diff --git a/monitoring/NPalert/NPalert.spec b/monitoring/NPalert/NPalert.spec
index f1f8d75..4cc4cf8 100644
--- a/monitoring/NPalert/NPalert.spec
+++ b/monitoring/NPalert/NPalert.spec
@@ -43,6 +43,7 @@ mkdir -p --mode=755 $RPM_BUILD_ROOT%{_sysconfdir}/notification/generated
mkdir -p --mode=755 $RPM_BUILD_ROOT%{_sysconfdir}/notification/static
mkdir -p --mode=755 $RPM_BUILD_ROOT%{_sysconfdir}/notification/stage/config
mkdir -p --mode=755 $RPM_BUILD_ROOT%{_sysconfdir}/notification
+mkdir -p --mode=755 $RPM_BUILD_ROOT%{_sysconfdir}/smrsh
mkdir -p --mode=775 $RPM_BUILD_ROOT%install_prefix/queue/ack_queue
mkdir -p --mode=775 $RPM_BUILD_ROOT%install_prefix/queue/ack_queue/.new
mkdir -p --mode=775 $RPM_BUILD_ROOT%install_prefix/queue/alert_queue
@@ -54,6 +55,7 @@ mkdir -p --mode=755 $RPM_BUILD_ROOT%log_dir/ticketlog
# Create symlinks
ln -s ../../static $RPM_BUILD_ROOT%{_sysconfdir}/notification/stage/config/static
+ln -s /usr/bin/ack_enqueuer.pl $RPM_BUILD_ROOT%{_sysconfdir}/smrsh/ack_enqueuer.pl
# Install the perl modules
mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Notif
@@ -127,6 +129,7 @@ fi
%attr (755,%notif_user,%notif_user) %dir %log_dir/archive
%attr (755,%notif_user,%notif_user) %dir %log_dir/ticketlog
%attr(644,%notif_user,%notif_user) %{_sysconfdir}/notification/static/*
+%{_sysconfdir}/smrsh/ack_enqueuer.pl
%{_sysconfdir}/notification/stage/config/static
%{_mandir}/man3/monitor-queue*
%{_mandir}/man3/queue_remote_check.pl*
commit 713b4fb4999e2577935b04aff1a6b1c3daae8b7c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 24 16:22:08 2011 +0100
LWP::UserAgent is required by tesl.pl (tests run in buildtime)
diff --git a/monitoring/PerlModules/NP/Gritch/perl-NOCpulse-Gritch.spec b/monitoring/PerlModules/NP/Gritch/perl-NOCpulse-Gritch.spec
index 9c38a56..7422dc3 100644
--- a/monitoring/PerlModules/NP/Gritch/perl-NOCpulse-Gritch.spec
+++ b/monitoring/PerlModules/NP/Gritch/perl-NOCpulse-Gritch.spec
@@ -9,6 +9,7 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version
BuildRequires: perl(NOCpulse::Config)
BuildRequires: perl(NOCpulse::Debug) perl(ExtUtils::MakeMaker)
BuildRequires: perl(Mail::Send)
+BuildRequires: perl-libwww-perl
Group: Development/Libraries
License: GPLv2
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
commit 0c823501e1cb05fe3af887cfac908fd72cc1b92d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 18 14:04:02 2011 +0100
493028 - directory for notifications should be created
diff --git a/monitoring/nocpulse-common/nocpulse-common.spec b/monitoring/nocpulse-common/nocpulse-common.spec
index 8dd8faf..61590c0 100644
--- a/monitoring/nocpulse-common/nocpulse-common.spec
+++ b/monitoring/nocpulse-common/nocpulse-common.spec
@@ -53,6 +53,7 @@ install -m644 nocpulse.logrotate \
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}
install -m644 NOCpulse.ini $RPM_BUILD_ROOT/%{_sysconfdir}/%{package_name}/NOCpulse.ini
+install -m755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/%{package_name}/NOCpulse/tmp
install -m644 forward $RPM_BUILD_ROOT/%{_var}/lib/%{package_name}/.forward
mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Config/test
mkdir -p $RPM_BUILD_ROOT%{_bindir}
@@ -129,6 +130,7 @@ fi
%defattr(-, root,root,-)
%dir %{_sysconfdir}/nocpulse
%config(missingok,noreplace) %{_sysconfdir}/%{package_name}/NOCpulse.ini
+%{_sysconfdir}/%{package_name}/NOCpulse
%config(missingok,noreplace) %attr(-, %{package_name},%{package_name}) %{_var}/lib/%{package_name}/.forward
%{_bindir}/npConfigValue
%dir %{perl_vendorlib}/NOCpulse
commit 4cc3615ea27abbeaed70ba9137c6db180613ba7f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 24 15:46:14 2011 +0100
493028 - select all but expired redirects
diff --git a/monitoring/NPalert/NotificationDB.pm b/monitoring/NPalert/NotificationDB.pm
index 0c2e790..44343e5 100644
--- a/monitoring/NPalert/NotificationDB.pm
+++ b/monitoring/NPalert/NotificationDB.pm
@@ -305,7 +305,7 @@ sub select_active_redirects {
RECURRING_FREQUENCY,
RECURRING_DURATION
FROM $table
- WHERE SYSDATE BETWEEN START_DATE AND EXPIRATION
+ WHERE SYSDATE < EXPIRATION
EOSQL
my $redirptr = $self->execute($sql, $table, FETCH_ARRAYREF);
@@ -331,7 +331,7 @@ EOSQL
FROM
$table, $table2
WHERE
- SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
+ SYSDATE < $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -355,7 +355,7 @@ EOSQL
FROM
$table, $table2
WHERE
- SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
+ SYSDATE < $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -378,7 +378,7 @@ EOSQL
FROM
$table, $table2
WHERE
- SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
+ SYSDATE < $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -412,7 +412,7 @@ sub select_active_redirect_criteria {
$table.MATCH_VALUE,
$table.INVERTED
FROM $table, $table2
- WHERE SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
+ WHERE SYSDATE < $table2.EXPIRATION
AND $table2.RECID = $table.REDIRECT_ID
ORDER BY $table.REDIRECT_ID, $table.MATCH_PARAM
EOSQL
commit ded741a392d3a66215087833b104207e7d892add
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 24 14:08:20 2011 +0100
493028 - empty TZ is interpreted as GMT not local timezone; it must be unset
diff --git a/monitoring/NPalert/scripts/generate-config b/monitoring/NPalert/scripts/generate-config
index 735c1b6..4debe5b 100755
--- a/monitoring/NPalert/scripts/generate-config
+++ b/monitoring/NPalert/scripts/generate-config
@@ -648,7 +648,11 @@ sub zonify_daily {
} ## end foreach my $zone (sort(@zones...
- $ENV{'TZ'} = $oldtz;
+ if ($oldtz) {
+ $ENV{'TZ'} = $oldtz;
+ } else {
+ delete $ENV{'TZ'};
+ }
# Note: log OK again
} ## end sub zonify_daily
commit 1f78ede001e3a7d6964cb220f5facad3d123bed9
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Feb 23 16:51:44 2011 +0100
493028 - dates in db are in localtime not GMT
diff --git a/monitoring/NPalert/httpd/cgi-bin/redirmgr.cgi b/monitoring/NPalert/httpd/cgi-bin/redirmgr.cgi
index 8f4f251..f11a195 100755
--- a/monitoring/NPalert/httpd/cgi-bin/redirmgr.cgi
+++ b/monitoring/NPalert/httpd/cgi-bin/redirmgr.cgi
@@ -207,7 +207,6 @@ my $MAX_CRITERIA = 15;
# M A I N
#----------------------------------------------
-$ENV{TZ}='GMT';
#----- Create a new CGI object
$query = new CGI;
diff --git a/monitoring/NPalert/scripts/generate-config b/monitoring/NPalert/scripts/generate-config
index 1e6ac3f..735c1b6 100755
--- a/monitoring/NPalert/scripts/generate-config
+++ b/monitoring/NPalert/scripts/generate-config
@@ -19,7 +19,6 @@ use Data::Dumper;
my $bailout;
$SIG{'INT'} = $SIG{'TERM'} = sub { $bailout = 1; };
-$ENV{TZ} = 'GMT';
$| = 1;
# Constants for time conversion
diff --git a/monitoring/NPalert/scripts/notif b/monitoring/NPalert/scripts/notif
index 87c824e..540ddc6 100644
--- a/monitoring/NPalert/scripts/notif
+++ b/monitoring/NPalert/scripts/notif
@@ -8,7 +8,6 @@ use NOCpulse::Notif::EscalatorInterface;
use NOCpulse::Notif::Send;
use NOCpulse::Notif::SendInfo;
-$ENV{TZ}='GMT';
umask(002);
my $np_cfg = new NOCpulse::Config;
diff --git a/monitoring/NPalert/scripts/notif-escalator b/monitoring/NPalert/scripts/notif-escalator
index 0078928..20282c6 100755
--- a/monitoring/NPalert/scripts/notif-escalator
+++ b/monitoring/NPalert/scripts/notif-escalator
@@ -22,7 +22,6 @@ use NOCpulse::Notif::RotateFirstEscalateStrategy;
use Data::Dumper;
-$ENV{TZ}='GMT';
umask(002);
my $program='notif-escalator';
diff --git a/monitoring/NPalert/scripts/notif-launcher b/monitoring/NPalert/scripts/notif-launcher
index bc04626..ec77dd3 100755
--- a/monitoring/NPalert/scripts/notif-launcher
+++ b/monitoring/NPalert/scripts/notif-launcher
@@ -15,7 +15,6 @@ use NOCpulse::Notif::AlertFile;
use NOCpulse::Notif::AlertDB; #for current alerts
use NOCpulse::Notif::EscalatorInterface;
-$ENV{TZ}='GMT';
use constant DEF_UNIX_DATE_FMT => '%m-%d-%Y %H:%M:%S';
umask(002);
diff --git a/monitoring/NPalert/scripts/notifier b/monitoring/NPalert/scripts/notifier
index cc0dbc5..515d390 100755
--- a/monitoring/NPalert/scripts/notifier
+++ b/monitoring/NPalert/scripts/notifier
@@ -11,7 +11,6 @@ use NOCpulse::Notif::AlertDB;
use NOCpulse::Notif::EscalatorInterface;
use NOCpulse::Notif::RotateFirstEscalateStrategy;
-$ENV{TZ} = 'GMT';
umask(002);
my $program = 'notifier';
commit 80f658595a320fd2bdcad867bba5a9801015919f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 18 13:40:49 2011 +0100
493028 - get_sendmail() has been removed in ae8275b5435a56e322387c060ca5d91c5dc79ab1
diff --git a/monitoring/PerlModules/NP/Gritch/Gritch.pm b/monitoring/PerlModules/NP/Gritch/Gritch.pm
index b230f74..6970836 100644
--- a/monitoring/PerlModules/NP/Gritch/Gritch.pm
+++ b/monitoring/PerlModules/NP/Gritch/Gritch.pm
@@ -405,7 +405,6 @@ sub sendmail {
}
} else {
# Use sendmail
- my $sendmail = get_sendmail();
if (Mail::Mailer::is_exe('sendmail')) {
my $msg = Mail::Send->new(Subject => $subject, To => $recip, From => $self->recipient);
my $fh = $msg->open('sendmail');
commit 614d78e76f70047117a7cb5a54e6f2dc1dcb590b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jan 21 14:21:40 2011 +0100
493028 - fixed active redirects query condition
diff --git a/monitoring/NPalert/NotificationDB.pm b/monitoring/NPalert/NotificationDB.pm
index 0f9c4b3..0c2e790 100644
--- a/monitoring/NPalert/NotificationDB.pm
+++ b/monitoring/NPalert/NotificationDB.pm
@@ -305,8 +305,7 @@ sub select_active_redirects {
RECURRING_FREQUENCY,
RECURRING_DURATION
FROM $table
- WHERE EXPIRATION >= SYSDATE
- AND START_DATE <= SYSDATE + 1
+ WHERE SYSDATE BETWEEN START_DATE AND EXPIRATION
EOSQL
my $redirptr = $self->execute($sql, $table, FETCH_ARRAYREF);
@@ -332,8 +331,7 @@ EOSQL
FROM
$table, $table2
WHERE
- $table2.EXPIRATION >= SYSDATE
- AND $table2.START_DATE <= SYSDATE + 1
+ SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -357,8 +355,7 @@ EOSQL
FROM
$table, $table2
WHERE
- $table2.EXPIRATION >= SYSDATE
- AND $table2.START_DATE <= SYSDATE + 1
+ SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -381,8 +378,7 @@ EOSQL
FROM
$table, $table2
WHERE
- $table2.EXPIRATION >= SYSDATE
- AND $table2.START_DATE <= SYSDATE + 1
+ SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
AND $table.REDIRECT_ID = $table2.RECID
EOSQL
@@ -416,8 +412,7 @@ sub select_active_redirect_criteria {
$table.MATCH_VALUE,
$table.INVERTED
FROM $table, $table2
- WHERE $table2.EXPIRATION >= SYSDATE
- AND $table2.START_DATE <= SYSDATE + 1
+ WHERE SYSDATE BETWEEN $table2.START_DATE AND $table2.EXPIRATION
AND $table2.RECID = $table.REDIRECT_ID
ORDER BY $table.REDIRECT_ID, $table.MATCH_PARAM
EOSQL
11 years, 5 months
2 commits - backend/satellite_tools backend/server
by Michael Mraka
backend/satellite_tools/rhn_ssl_dbstore.py | 18 +--------
backend/server/rhnChannel.py | 27 --------------
backend/server/rhnDependency.py | 53 +----------------------------
backend/server/rhnLib.py | 24 +++++++++++++
4 files changed, 30 insertions(+), 92 deletions(-)
New commits:
commit 694813a5ac6a9571609fc3a97a7d4895ee05c132
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Mar 2 12:14:10 2011 +0100
merged/moved make_evr() implemetation into a single code
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index 8ca0610..646d814 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -975,7 +975,7 @@ def list_packages_source(channel_id):
r = r['name']
if string.find(r, ".rpm") != -1:
r = string.replace(r, ".rpm", "")
- new_evr = make_evr(r,source=1)
+ new_evr = rhnLib.make_evr(r,source=1)
new_evr_list = [new_evr['name'], new_evr['version'], new_evr['release'],new_evr['epoch']]
ret.append(new_evr_list)
@@ -1901,31 +1901,6 @@ def system_reg_message(server):
return -1, no_entitlement_title, no_entitlement_message % params
return 0, "", ""
-# IN: 'e:name-version-release' or 'name-version-release:e'
-# OUT: {'name':name, 'version':version, 'release':release, 'epoch':epoch }
-def make_evr(nvre, source=False):
- import re
- if ":" in nvre:
- nvr, epoch = nvre.rsplit(":", 1)
- if "-" in epoch:
- nvr, epoch = epoch, nvr
- else:
- nvr, epoch = nvre, ""
-
- nvr_parts = nvr.rsplit("-", 2)
- if len(nvr_parts) != 3:
- raise rhnFault(err_code = 21, err_text = \
- "NVRE is missing name, version, or release.")
-
- result = dict(zip(["name", "version", "release"], nvr_parts))
- result["epoch"] = epoch
-
- if source and result["release"].endswith(".src"):
- result["release"] = result["release"][:-4]
-
- return result
-
-
def subscribe_to_tools_channel(server_id):
"""
Subscribes server_id to the RHN Tools channel associated with its base channel, if one exists.
diff --git a/backend/server/rhnDependency.py b/backend/server/rhnDependency.py
index 582090e..4e121f9 100644
--- a/backend/server/rhnDependency.py
+++ b/backend/server/rhnDependency.py
@@ -16,7 +16,7 @@
from spacewalk.common import log_debug, log_error
from spacewalk.common.rhnException import rhnFault
-import rhnSQL
+import rhnSQL, rhnLib
import rpm
import string
@@ -297,55 +297,6 @@ def __single_query_with_arch_and_id(server_id, deps, query):
ret[dep] = map(lambda a: a[:6], data)
return ret
-def make_evr(nvre):
- """ IN: 'e:name-version-release' or 'name-version-release:e'
- OUT: {'name':name, 'version':version, 'release':release, 'epoch':epoch }
- """
- epoch = ''
- name = ''
- version = ''
- release = ''
- list = None
- ret = None
-
- #There is an epoch
- if string.find(nvre, ':') != -1:
- holder = string.split(nvre, ':')
-
- #holder[0] has the n,v,r,a
- if string.find(holder[0], '-') != -1:
- holder[0] = string.split(holder[0], '-')
- ret = {
- 'name' : '-'.join(holder[0][:-2]),
- 'version' : holder[0][-2],
- 'release' : holder[0][-1],
- 'epoch' : holder[1]
- }
- return ret
- elif string.find(holder[1], '-') != -1:
- holder[1] = string.split(holder[1], '-')
- ret = {
- 'name' : '-'.join(holder[1][:-2]),
- 'version' : holder[1][-2],
- 'release' : holder[1][-1],
- 'epoch' : holder[0]
- }
- return ret
- else:
- raise rhnFault(err_code = 21,
- err_text = "NVRE is missing name, version, or release.")
- elif string.find(nvre, '-') != -1:
- nvre = string.split(nvre, '-')
- ret = {
- 'name' : '-'.join(nvre[:-2]),
- 'version' : nvre[-2],
- 'release' : nvre[-1],
- 'epoch' : None
- }
- return ret
- else:
- return MakeEvrError(message = "NVRE is missing name, version, or release.")
-
#
# Interfaces
#
@@ -422,7 +373,7 @@ def solve_dependencies_with_limits(server_id, deps, version, all = 0, limit_oper
keep_list = []
try:
- limit = make_evr(limit)
+ limit = rhnLib.make_evr(limit)
except:
raise
diff --git a/backend/server/rhnLib.py b/backend/server/rhnLib.py
index d83407c..24a6694 100644
--- a/backend/server/rhnLib.py
+++ b/backend/server/rhnLib.py
@@ -196,3 +196,27 @@ class CallableObj:
def __call__(self, *args, **kwargs):
return apply(self.func, (self.name, ) + args, kwargs)
+
+def make_evr(nvre):
+ """ IN: 'e:name-version-release' or 'name-version-release:e'
+ OUT: {'name':name, 'version':version, 'release':release, 'epoch':epoch }
+ """
+ if ":" in nvre:
+ nvr, epoch = nvre.rsplit(":", 1)
+ if "-" in epoch:
+ nvr, epoch = epoch, nvr
+ else:
+ nvr, epoch = nvre, ""
+
+ nvr_parts = nvr.rsplit("-", 2)
+ if len(nvr_parts) != 3:
+ raise rhnFault(err_code = 21, err_text = \
+ "NVRE is missing name, version, or release.")
+
+ result = dict(zip(["name", "version", "release"], nvr_parts))
+ result["epoch"] = epoch
+
+ if source and result["release"].endswith(".src"):
+ result["release"] = result["release"][:-4]
+
+ return result
commit d6efd058e1f7ae75d56eb973cdb4cbb0826eb02b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Mar 2 11:46:27 2011 +0100
removed duplicated fetchTraceback()
diff --git a/backend/satellite_tools/rhn_ssl_dbstore.py b/backend/satellite_tools/rhn_ssl_dbstore.py
index 08b1926..fff40b2 100644
--- a/backend/satellite_tools/rhn_ssl_dbstore.py
+++ b/backend/satellite_tools/rhn_ssl_dbstore.py
@@ -25,18 +25,6 @@ import satCerts
DEFAULT_TRUSTED_CERT = 'RHN-ORG-TRUSTED-SSL-CERT'
-def fetchTraceback(method=None, req=None, extra=None):
- """ a cheat for snagging just the string value of a Traceback
- NOTE: this tool may be needed for RHN Satellite 3.2 as well,
- which doesn't have a fetchTraceback. So... this if for
- compatibility.
- """
- from cStringIO import StringIO
- exc = StringIO()
- rhnTB.Traceback(method=method, req=req, mail=0, ostream=exc,
- extra=extra, severity=None)
- return exc.getvalue()
-
def processCommandline():
initCFG('server.satellite')
@@ -73,7 +61,7 @@ def processCommandline():
sys.stderr.write("""\
ERROR: there was a problem trying to initialize the database:
-%s\n""" % fetchTraceback())
+%s\n""" % rhnTB.fetchTraceback())
sys.exit(11)
if values.verbose:
@@ -100,10 +88,10 @@ def main():
try:
satCerts.store_rhnCryptoKey(values.label, values.ca_cert, verbosity=values.verbose)
except satCerts.NoOrgIdError, e:
- writeError("no organization ID!?!\n\n%s\n" % fetchTraceback())
+ writeError("no organization ID!?!\n\n%s\n" % rhnTB.fetchTraceback())
sys.exit(12)
except satCerts.CaCertInsertionError, e:
- writeError("no organization ID!?!\n\n%s\n" % fetchTraceback())
+ writeError("no organization ID!?!\n\n%s\n" % rhnTB.fetchTraceback())
sys.exit(13)
return 0
11 years, 5 months
2 commits - web/modules
by Jan Pazdziora
web/modules/rhn/RHN/DB/SatInstall.pm | 21 ---------------------
web/modules/rhn/RHN/SatInstall.pm | 6 ------
2 files changed, 27 deletions(-)
New commits:
commit 4d03dce5d6bcc00d24d05711710b712228be710c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 13:48:16 2011 +0100
Removal of rhn-load-config.pl made RHN::DB::SatInstall::get_nls_database_parameters unused, removing.
diff --git a/web/modules/rhn/RHN/DB/SatInstall.pm b/web/modules/rhn/RHN/DB/SatInstall.pm
index 6be8f58..806a122 100644
--- a/web/modules/rhn/RHN/DB/SatInstall.pm
+++ b/web/modules/rhn/RHN/DB/SatInstall.pm
@@ -50,27 +50,6 @@ EOQ
};
}
-sub get_nls_database_parameters {
- my $class = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare(<<EOQ);
-SELECT NDP.parameter, NDP.value
- FROM nls_database_parameters NDP
-EOQ
-
- $sth->execute();
-
- my %nls_database_parameters;
-
- while (my ($param, $value) = $sth->fetchrow()) {
- $nls_database_parameters{$param} = $value;
- }
-
- return %nls_database_parameters;
-}
-
sub update_monitoring_config {
my $class = shift;
my $mon_config = shift;
commit 80335bd250ab0a3b7fb5191435073200bfef94aa
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 13:45:55 2011 +0100
Removal of rhn-load-config.pl made RHN::SatInstall::generate_secret unused, removing.
diff --git a/web/modules/rhn/RHN/SatInstall.pm b/web/modules/rhn/RHN/SatInstall.pm
index 595e978..aa579b2 100644
--- a/web/modules/rhn/RHN/SatInstall.pm
+++ b/web/modules/rhn/RHN/SatInstall.pm
@@ -19,7 +19,6 @@ use strict;
use File::Spec;
use Frontier::Client;
-use Digest::MD5 qw/md5_hex/;
use English;
use POSIX qw/dup2 setsid O_WRONLY O_CREAT/;
@@ -31,7 +30,6 @@ use RHN::DB;
use Params::Validate;
Params::Validate::validation_options(strip_leading => "-");
-use PXT::Utils;
use RHN::Exception qw/throw/;
use RHN::DB::SatInstall;
@@ -78,10 +76,6 @@ sub write_config {
return;
}
-sub generate_secret {
- return md5_hex(PXT::Utils->random_bits(4096));
-}
-
my %server_cert_opts = (
dir => 1,
password => 1,
11 years, 5 months
2 commits - spacewalk/setup
by Jan Pazdziora
spacewalk/setup/share/upgrade/rhn-enable-push.pl | 95 ----------
spacewalk/setup/share/upgrade/rhn-load-config.pl | 203 -----------------------
2 files changed, 298 deletions(-)
New commits:
commit cdbd1d82be665b05f67d649a664e406b5d33e39b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 13:40:21 2011 +0100
Removing rhn-enable-push.pl as it is not referenced from anywhere.
diff --git a/spacewalk/setup/share/upgrade/rhn-enable-push.pl b/spacewalk/setup/share/upgrade/rhn-enable-push.pl
deleted file mode 100644
index 848cfdc..0000000
--- a/spacewalk/setup/share/upgrade/rhn-enable-push.pl
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use lib '/var/www/lib';
-
-use English;
-
-use Data::Dumper;
-use Getopt::Long;
-use Sys::Hostname;
-
-use PXT::Utils;
-use PXT::Request;
-use RHN::SatInstall;
-use RHN::DB;
-use Spacewalk::Setup;
-
-my %opts = ();
-my @valid_opts = (
- "hostname:s",
- "ssl-dir:s",
- "pub-ssl-cert:s",
- "force",
- "help",
- );
-
-my $usage = "usage: $0 [ --hostname=<override_hostname> ] [ --ssl-dir=<ssl_build_directory> ]"
- . " [ --pub-ssl-cert=<public_ssl_certificate> ] [ --force ]"
- . " [ --help ]\n";
-
-GetOptions(\%opts, @valid_opts) or die $usage;
-
-if ($opts{help}) {
- die $usage;
-}
-
-unless ($opts{force}) {
- my $jabber_server = PXT::Config->get('osa-dispatcher', 'jabber_server') || '';
-
- if ($jabber_server and $jabber_server !~ /@@/) {
- die "Push is already enabled - do not run this script more than once. Use --force to override.\n";
- }
-}
-
-my $db_connect = RHN::SatInstall->test_db_connection();
-
-die "Could not connect to the database"
- unless $db_connect;
-
-my @hostname_parts = split(/\./, $opts{hostname} || Sys::Hostname::hostname);
-my $system_name;
-
-if (scalar @hostname_parts > 2) {
- $system_name = join('.', splice(@hostname_parts, 0, -2));
-}
-else {
- $system_name = join('.', @hostname_parts);
-}
-
-
-# nuke the jabberd generated authentication database
-if (-e '/var/lib/jabberd/authreg.db') {
- unlink ('/var/lib/jabberd/authreg.db');
-}
-
-if (-e '/var/lib/jabberd/sm.db') {
- unlink ('/var/lib/jabberd/sm.db');
-}
-
-Spacewalk::Setup::generate_server_pem(-ssl_dir => $opts{"ssl-dir"} || '/root/ssl-build',
- -system => $system_name,
- -out_file => '/etc/jabberd/server.pem');
-
-my %config_opts;
-
-$config_opts{jabberDOThostname} = $opts{hostname} || Sys::Hostname::hostname();
-$config_opts{jabberDOTusername} = 'rhn-dispatcher-sat';
-$config_opts{jabberDOTpassword} = 'rhn-dispatcher-' . PXT::Utils->random_password(6);
-$config_opts{osadispatcherDOTosa_ssl_cert} = $opts{'pub-ssl-cert'} || '/var/www/html/pub/RHN-ORG-TRUSTED-SSL-CERT';
-
-RHN::SatInstall->write_config(\%config_opts,
- '/var/lib/rhn/rhn-satellite-prep/satellite-local-rules.conf');
-
-print "Deploying config\n";
-
-Spacewalk::Setup::satcon_deploy();
-
-print "Restarting satellite services\n";
-system("/usr/sbin/rhn-satellite", "restart");
-
-print "Done\n";
-
-exit 0;
commit 1451c0961362b2bec1ad2994c515846a400e8f69
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 13:38:14 2011 +0100
Removing rhn-load-config.pl as it is not referenced from anywhere.
diff --git a/spacewalk/setup/share/upgrade/rhn-load-config.pl b/spacewalk/setup/share/upgrade/rhn-load-config.pl
deleted file mode 100755
index 33eb7f3..0000000
--- a/spacewalk/setup/share/upgrade/rhn-load-config.pl
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use lib '/var/www/lib';
-
-use English;
-
-use Data::Dumper;
-use Getopt::Long;
-use Sys::Hostname;
-
-use PXT::Utils;
-
-use RHN::SatInstall;
-use RHN::SatCluster;
-use RHN::DB;
-use RHN::DataSource::Simple;
-use PXT::Config;
-use PXT::Request;
-use Spacewalk::Setup;
-
-my %opts = ();
-my @valid_opts = (
- "force",
- "disable-solaris",
- "help",
- );
-
-my $usage = "usage: $0 [ --force ]"
- . " [ --disable-solaris ]"
- . " [ --help ]\n";
-
-GetOptions(\%opts, @valid_opts) or die $usage;
-
-if ($opts{help}) {
- die $usage;
-}
-
-my ($already_monitoring, $already_monitoring_scout, $already_osad);
-
-my $mon_backend = PXT::Config->get('is_monitoring_backend') || '';
-if ($mon_backend and $mon_backend !~ /@@/) {
- $already_monitoring = 1;
-}
-
-my $mon_scout = PXT::Config->get('is_monitoring_scout') || '';
-if ($mon_scout and $mon_scout !~ /@@/) {
- $already_monitoring_scout = 1;
-}
-
-my $jabber_server = PXT::Config->get('osa-dispatcher', 'jabber_server') || '';
-if ($jabber_server and $jabber_server !~ /@@/) {
- $already_osad = 1;
-}
-
-print "Generating RHN Satellite configuration dictionary\n";
-
-Spacewalk::Setup::generate_satcon_dict();
-
-print "Examining current configuration\n";
-
-my %config_opts;
-
-my @valid_keys = qw/db_name db_user db_password encrypted_passwords
- kickstart_mount_point mount_point serverDOTsatelliteDOTca_chain
- serverDOTsatelliteDOThttp_proxy
- serverDOTsatelliteDOThttp_proxy_username
- serverDOTsatelliteDOTrhn_parent session_secret_1 session_secret_2
- session_secret_3 session_secret_4 session_swap_secret_1
- session_swap_secret_2 session_swap_secret_3 session_swap_secret_4
- traceback_mail webDOTis_monitoring_backend webDOTis_monitoring_scout
- webDOTssl_available serverDOTsatelliteDOThttp_proxy_password/;
-
-foreach my $key (@valid_keys) {
- $config_opts{$key} = check_current_config($key);
-}
-
-$config_opts{server_secret_key} = RHN::SatInstall->generate_secret;
-
-load_jabber_configs(\%config_opts);
-
-if ($opts{disable_solaris}) {
- $config_opts{webDOTenable_solaris_support} = 0;
-}
-else {
- $config_opts{webDOTenable_solaris_support} = 1;
-}
-
-if ($already_monitoring) {
- $config_opts{monitoringDOTdbd} = 'Oracle';
- $config_opts{monitoringDOTorahome} = $ENV{ORACLE_HOME} || '/opt/oracle';
- $config_opts{monitoringDOTdbname} = $config_opts{'db_name'};
- $config_opts{monitoringDOTusername} = $config_opts{'db_user'};
- $config_opts{monitoringDOTpassword} = $config_opts{'db_password'};
-
- if ($already_monitoring_scout) {
- my $scout_shared_key = find_scout_key();
-
- $config_opts{monitoringDOTsmonDOTaddr} = '127.0.0.1';
- $config_opts{monitoringDOTsmonDOTfqdn} = 'localhost';
- $config_opts{monitoringDOTsmonDOTtestaddr} = '127.0.0.1';
- $config_opts{monitoringDOTsmonDOTtestfqdn} = 'localhost';
- $config_opts{monitoringDOTscout_shared_key} = $scout_shared_key;
-
- # if the satellite is already a monitoring scout, we need to update some ip address fields
- update_ip_addresses();
- }
-}
-
-my %nls_database_paramaters = RHN::SatInstall->get_nls_database_parameters();
-$config_opts{serverDOTnls_lang} = 'english.' . $nls_database_paramaters{NLS_CHARACTERSET};
-$config_opts{cobblerDOThost} = Sys::Hostname::hostname;
-print "Writing configuration\n";
-RHN::SatInstall->write_config(\%config_opts,
- '/var/lib/rhn/rhn-satellite-prep/satellite-local-rules.conf');
-
-
-Spacewalk::Setup::satcon_deploy();
-
-print "Done\n";
-
-exit 0;
-
-sub update_ip_addresses {
- my $hostname = Sys::Hostname::hostname;
- my $ip_addr = RHN::Utils::find_ip_address($hostname);
-
- my $dbh = RHN::DB->connect();
- my $sth;
-
- # update recid 1 of the rhn_sat_cluster table,
- # which is always the cluster record for the scout on the satellite
- $sth = $dbh->prepare(<<EOQ);
-UPDATE rhn_Sat_Cluster
- SET vip = :ip
- WHERE recid = 1
-EOQ
- $sth->execute_h(ip => $ip_addr);
-
- # update recid 2 of the rhn_sat_node table,
- # which is always the node record for the scout on the satellite
- $sth = $dbh->prepare(<<EOQ);
-UPDATE rhn_Sat_Node
- SET ip = :ip
- WHERE recid = 2
-EOQ
- $sth->execute_h(ip => $ip_addr);
-
- $dbh->commit;
-}
-
-sub check_current_config {
- my $key = shift;
-
- $key =~ s/DOT/./g;
-
- my ($domain, $var);
- if ($key =~ /^(.*)\.(.*)$/) {
- $domain = $1;
- $var = $2;
- }
- else {
- $domain = 'web';
- $var = $key;
- }
-
- my $value = PXT::Config->get($domain, $var);
- if ($value =~ /^@@/) {
- return;
- }
-
- return $value;
-}
-
-#We have to do a mapping of the fake options to real options
-sub load_jabber_configs {
- my $config_opts = shift;
- my %jabberOpts = (
- "jabberDOThostname" => "server.jabber_server",
- "osadispatcherDOTosa_ssl_cert" => "osa-dispatcher.osa_ssl_cert",
- "jabberDOTusername" => "osa-dispatcher.jabber_username",
- "jabberDOTpassword" => "osa-dispatcher.jabber_password"
- );
- while ( my ($key, $value) = each(%jabberOpts) ) {
- $config_opts->{$key} = PXT::Config->get(split('\.', $value));
- }
-
-}
-
-sub find_scout_key {
- my $ds = new RHN::DataSource::Simple(-querybase => "scout_queries",
- -mode => 'scouts_for_org');
- my $data = $ds->execute_query(-org_id => 1);
-
- my ($sat_scout) = grep { not $_->{SERVER_ID} } @{$data};
-
- die "No satellite scout found!" unless $sat_scout;
-
- return $sat_scout->{SCOUT_SHARED_KEY};
-}
-
11 years, 5 months
backend/server
by Jan Pazdziora
backend/server/importlib/headerSource.py | 9 ---------
1 file changed, 9 deletions(-)
New commits:
commit 48701b89c48789809d521dbd7a7a167f6b4ff6f7
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 13:26:28 2011 +0100
The sanitizePath is not used after _populateFromFile removal, removing.
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index 92e63d4..b367a00 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -344,15 +344,6 @@ class rpmChangeLog(ChangeLog):
except UnicodeDecodeError:
self[i] = unicode(self[i], "iso-8859-1")
-def sanitizePath(path):
- if not path:
- return ""
- while path:
- if path[-1] != '/':
- break
- path = path[:-1]
- return path
-
def sanitizeList(l):
if l is None:
return []
11 years, 5 months
client/tools
by Jan Pazdziora
client/tools/spacewalk-remote-utils/spacewalk-create-channel/doc/spacewalk-create-channel.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 56c2e80c57a062efe68db7d77d954a434f1b3609
Author: Luc de Louw <luc(a)delouw.ch>
Date: Tue Mar 1 21:36:24 2011 +0100
Fixing description of the -u/--update option in spacewalk-create-channel man page.
diff --git a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/doc/spacewalk-create-channel.sgml b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/doc/spacewalk-create-channel.sgml
index 613f898..1cd84b6 100644
--- a/client/tools/spacewalk-remote-utils/spacewalk-create-channel/doc/spacewalk-create-channel.sgml
+++ b/client/tools/spacewalk-remote-utils/spacewalk-create-channel/doc/spacewalk-create-channel.sgml
@@ -134,7 +134,7 @@ the Spacewalk or Satellite server.
<varlistentry>
<term>-u<replaceable>UPDATE</replaceable>, --update=<replaceable>UPDATE</replaceable></term>
<listitem>
- <para>The update level of a channel to create (e.g. i386, ia64, ppc, s390, s390x, x86_64).</para>
+ <para>The update level of a channel to create (e.g. gold,u1,u2,u3,u4,u5,u6,u7,u8,u9), where gold stands for the initial release.</para>
</listitem>
</varlistentry>
<varlistentry>
11 years, 5 months
Changes to 'refs/tags/spacewalk-backend-1.4.14-1'
by Jan Pazdziora
Tag 'spacewalk-backend-1.4.14-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2011-03-02 09:30 +0000
Tagging package [spacewalk-backend] version [1.4.14-1] in directory [backend/].
Changes since spacewalk-config-1.4.2-1:
Jan Pazdziora (3):
Only try to show e.code when the exception is cx_Oracle._Error.
Prevent all nulls in a chunk (which are treated as strings) from affecting the subsequent chunks.
Automatic commit of package [spacewalk-backend] release [1.4.14-1].
Johannes Renner (1):
do not show delete link on creation of notes (bnc#672090)
---
backend/server/rhnSQL/driver_cx_Oracle.py | 11 +++++++++--
backend/spacewalk-backend.spec | 7 ++++++-
java/code/webapp/WEB-INF/pages/systems/sdc/note_edit.jsp | 15 ++++++++-------
rel-eng/packages/spacewalk-backend | 2 +-
4 files changed, 24 insertions(+), 11 deletions(-)
---
11 years, 5 months
backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/spacewalk-backend.spec | 7 ++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit 796af3edf5c56acb10637cbfe9de2dc2a5e12872
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 10:30:55 2011 +0100
Automatic commit of package [spacewalk-backend] release [1.4.14-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 193eb10..ba18c1d 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.4.13
+Version: 1.4.14
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -686,6 +686,11 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Wed Mar 02 2011 Jan Pazdziora 1.4.14-1
+- Prevent all nulls in a chunk (which are treated as strings) from affecting
+ the subsequent chunks.
+- Only try to show e.code when the exception is cx_Oracle._Error.
+
* Mon Feb 28 2011 Jan Pazdziora 1.4.13-1
- removed unused updateChannelFamilyInfo() (michael.mraka(a)redhat.com)
- removed dead function check_with_seclist() (michael.mraka(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 8d221b0..3ebdc31 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.4.13-1 backend/
+1.4.14-1 backend/
11 years, 5 months
backend/server
by Jan Pazdziora
backend/server/rhnSQL/driver_cx_Oracle.py | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 179e8d6c75d79a5c81b1a1d558f8d258dfc6fafc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 2 10:28:25 2011 +0100
Prevent all nulls in a chunk (which are treated as strings) from affecting the subsequent chunks.
We clear self->bindVariables so that list of all nulls
in the previous chunk which caused the type to be set to
string does not affect our chunk which may have number
there.
Addressing
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 98, in _execute_wrapper
retval = apply(function, p, kw)
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 189, in _executemany
self._real_cursor.executemany(None, arr)
TypeError: expecting string or buffer data
diff --git a/backend/server/rhnSQL/driver_cx_Oracle.py b/backend/server/rhnSQL/driver_cx_Oracle.py
index 6fc77d0..7dbdbe4 100644
--- a/backend/server/rhnSQL/driver_cx_Oracle.py
+++ b/backend/server/rhnSQL/driver_cx_Oracle.py
@@ -183,6 +183,12 @@ class Cursor(sql_base.Cursor):
for k, v in kwargs.iteritems():
pdict[k] = adjust_type(v[start+i])
+ # We clear self->bindVariables so that list of all nulls
+ # in the previous chunk which caused the type to be set to
+ # string does not affect our chunk which may have number
+ # there.
+ self._real_cursor.setinputsizes(**{})
+
# arr is now a list of dictionaries. Each dictionary contains the
# data for one execution of the query where the key is the column
# name and the value self explanatory.
11 years, 5 months
backend/server
by Jan Pazdziora
backend/server/rhnSQL/driver_cx_Oracle.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 87434cc4dcfa483bc19f1c74b844c8fffde84286
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Mar 1 17:06:51 2011 +0100
Only try to show e.code when the exception is cx_Oracle._Error.
Addressing
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 100, in _execute_wrapper
ret = self._get_oracle_error_info(e)
File "/usr/lib/python2.4/site-packages/spacewalk/server/rhnSQL/driver_cx_Oracle.py", line 202, in _get_oracle_error_info
if isinstance(e, cx_Oracle._Error):
AttributeError: 'str' object has no attribute 'code'
diff --git a/backend/server/rhnSQL/driver_cx_Oracle.py b/backend/server/rhnSQL/driver_cx_Oracle.py
index e963b2c..6fc77d0 100644
--- a/backend/server/rhnSQL/driver_cx_Oracle.py
+++ b/backend/server/rhnSQL/driver_cx_Oracle.py
@@ -197,8 +197,9 @@ class Cursor(sql_base.Cursor):
def _get_oracle_error_info(self, error):
if isinstance(error, cx_Oracle.DatabaseError):
e = error[0]
- return (e.code, e.message, self.sql)
- return str(error)
+ if isinstance(e, cx_Oracle._Error):
+ return (e.code, e.message, self.sql)
+ return (None, str(error), self.sql)
# so we can "inherit" the self._real_cursor functions
def __getattr__(self, name):
11 years, 5 months