Changes to 'refs/tags/spacewalk-web-1.2.8-1'
by Miroslav Suchý
Tag 'spacewalk-web-1.2.8-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-09-27 16:53 +0000
Tagging package [spacewalk-web] version [1.2.8-1] in directory [web/].
Changes since NPalert-1.126.16-1:
Miroslav Suchý (1):
Automatic commit of package [spacewalk-web] release [1.2.8-1].
---
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
13 years, 7 months
rel-eng/packages web/spacewalk-web.spec
by Miroslav Suchý
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 71c0a3cbd94c503413b09880ac24db2956bbb278
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Sep 27 18:53:27 2010 +0200
Automatic commit of package [spacewalk-web] release [1.2.8-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index 4b7e69a..0b49107 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-1.2.7-1 web/
+1.2.8-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 353433e..ae06af4 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -2,7 +2,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.2.7
+Version: 1.2.8
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -256,6 +256,17 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Mon Sep 27 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.2.8-1
+- 636653 - Made the Channel Family Subscribed Systems page show guest systems
+ also (paji(a)redhat.com)
+- make 'db-control report' report TEMP_TBS statistics (mzazrivec(a)redhat.com)
+- 630585 - about-chat now points to proper channel (branding)
+ (lzap+git(a)redhat.com)
+- Cleanedup old/proted/unused config queries and updated the one for snapshot
+ (paji(a)redhat.com)
+- adding configchannel.lookupFileInfo() taking a revision id
+ (jsherril(a)redhat.com)
+
* Fri Sep 10 2010 Partha Aji <paji(a)redhat.com> 1.2.7-1
- 629606 - Fixed a list tag check box issue (paji(a)redhat.com)
- 591899 - fixing error where cloning an already cloned channel would still
13 years, 7 months
Changes to 'refs/tags/NPalert-1.126.16-1'
by Miroslav Suchý
Tag 'NPalert-1.126.16-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-09-27 16:41 +0000
Tagging package [NPalert] version [1.126.16-1] in directory [monitoring/NPalert/].
Changes since spacewalk-koan-0.2.8-1:
Aron Parsons (2):
Revert "591291 - added new API calls channel.software.mergeErrataWithPackages"
spacecmd: don't use mergeErrataWithPackages API
Jan Pazdziora (2):
The adler32 function does not seem to be used, removing.
Marked PostgreSQL schema sources that are PostgreSQL-specific.
Miroslav Suchý (4):
636224 - fix typos in mange and output of --help
636211 - include man page for monitor-queue
636211 - include man page for queue_remote_check.pl
Automatic commit of package [NPalert] release [1.126.16-1].
---
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 115 ----------
monitoring/NPalert/NPalert.spec | 12 -
monitoring/NPalert/scripts/monitor-queue | 54 ++++
monitoring/NPalert/scripts/queue_remote_check.pl | 52 +++-
monitoring/PerlModules/NP/Probe/monitoring-data-cleanup | 21 -
rel-eng/packages/NPalert | 2
schema/spacewalk/postgres/procs/adler32.sql | 74 ------
schema/spacewalk/postgres/procs/empty_blob.sql | 1
schema/spacewalk/postgres/procs/timestamp_minus_int.sql | 1
schema/spacewalk/postgres/tables/dual.sql | 2
schema/spacewalk/schema-source-sanity-check.pl | 54 ++--
spacecmd/src/lib/softwarechannel.py | 30 +-
12 files changed, 177 insertions(+), 241 deletions(-)
---
13 years, 7 months
monitoring/NPalert rel-eng/packages
by Miroslav Suchý
monitoring/NPalert/NPalert.spec | 6 +++++-
rel-eng/packages/NPalert | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 2d32e3dea858bbc12f20dda1721957a3badcb0d8
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Sep 27 18:41:50 2010 +0200
Automatic commit of package [NPalert] release [1.126.16-1].
diff --git a/monitoring/NPalert/NPalert.spec b/monitoring/NPalert/NPalert.spec
index 1d87aa9..700e110 100644
--- a/monitoring/NPalert/NPalert.spec
+++ b/monitoring/NPalert/NPalert.spec
@@ -9,7 +9,7 @@ Name: NPalert
Summary: NOCpulse notification system
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.126.15
+Version: 1.126.16
Release: 1%{?dist}
BuildArch: noarch
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
@@ -135,6 +135,10 @@ fi
rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Sep 27 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.126.16-1
+- 636211 - include man page for queue_remote_check.pl
+- 636211 - include man page for monitor-queue
+
* Mon Jul 19 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.126.15-1
- $self->dbh is method from MethodMaker and not attribute (msuchy(a)redhat.com)
diff --git a/rel-eng/packages/NPalert b/rel-eng/packages/NPalert
index 124a613..465aa17 100644
--- a/rel-eng/packages/NPalert
+++ b/rel-eng/packages/NPalert
@@ -1 +1 @@
-1.126.15-1 monitoring/NPalert/
+1.126.16-1 monitoring/NPalert/
13 years, 7 months
2 commits - monitoring/NPalert
by Miroslav Suchý
monitoring/NPalert/NPalert.spec | 6 ++
monitoring/NPalert/scripts/monitor-queue | 54 +++++++++++++++++++++++
monitoring/NPalert/scripts/queue_remote_check.pl | 52 +++++++++++++++++++---
3 files changed, 105 insertions(+), 7 deletions(-)
New commits:
commit 5a3abbfa337d031c0af11bbb994fb9c5a007b5e4
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Sep 27 18:39:52 2010 +0200
636211 - include man page for queue_remote_check.pl
diff --git a/monitoring/NPalert/NPalert.spec b/monitoring/NPalert/NPalert.spec
index 044bbdb..1d87aa9 100644
--- a/monitoring/NPalert/NPalert.spec
+++ b/monitoring/NPalert/NPalert.spec
@@ -93,6 +93,7 @@ install -p -m 644 cron/notification $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
/usr/bin/pod2man $RPM_BUILD_ROOT/%{_bindir}/monitor-queue | gzip > $RPM_BUILD_ROOT%{_mandir}/man3/monitor-queue.3pm.gz
+/usr/bin/pod2man $RPM_BUILD_ROOT/%{_bindir}/queue_remote_check.pl | gzip > $RPM_BUILD_ROOT%{_mandir}/man3/queue_remote_check.pl.3pm.gz
%post
if [ $1 -eq 2 ]; then
@@ -128,6 +129,7 @@ fi
%attr(644,%notif_user,%notif_user) %{_sysconfdir}/notification/static/*
%{_sysconfdir}/notification/stage/config/static
%{_mandir}/man3/monitor-queue*
+%{_mandir}/man3/queue_remote_check.pl*
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/monitoring/NPalert/scripts/queue_remote_check.pl b/monitoring/NPalert/scripts/queue_remote_check.pl
index 0d8185f..d9ebb4d 100755
--- a/monitoring/NPalert/scripts/queue_remote_check.pl
+++ b/monitoring/NPalert/scripts/queue_remote_check.pl
@@ -2,16 +2,16 @@
use strict;
use NOCpulse::Config;
+use Pod::Usage;
- my $CFG=NOCpulse::Config->new;
+my $CFG=NOCpulse::Config->new;
my $queue_name=$ARGV[0];
my $WARNING_QUEUE_SIZE = $ARGV[1];
my $CRITICAL_QUEUE_SIZE = $ARGV[2];
unless ($queue_name && $WARNING_QUEUE_SIZE && $CRITICAL_QUEUE_SIZE) {
- &help;
- exit(1);
+ pod2usage(1)
}
my $OK_EXIT = 0;
@@ -24,6 +24,10 @@ use NOCpulse::Config;
ACKS => 'ack_queue_dir',
REQUESTS => 'request_queue_dir' };
+ if (not $CFG) {
+ bailout("Error: /etc/NOCpulse.ini do not exist\n");
+ }
+
# Locate queue directory
my $QUEUE_DIR = $CFG->get('notification', $queue->{$queue_name});
chdir $QUEUE_DIR || &bailout("unable to find queue directory\n");
@@ -49,7 +53,41 @@ sub bailout {
exit($UNKNOWN_EXIT);
}
-sub help {
- print "$0 [queue name (ALERTS|ACKS|REQUESTS)] [warning level] [critical level]\n";
- print "This script is meant for use with the Command Center remote program check with data. It tracks the number of unprocessed requests current on disk for the specified queue.\n"
-}
+=pod
+
+=head1 NAME
+
+queue_remote_check.pl - monitor the queues from Spacewalk monitoring.
+
+=head1 SYNOPSIS
+
+queue_remote_check.pl QUEUE WARNING_QUEUE_SIZE CRITICAL_QUEUE_SIZE
+
+=head1 DESCRIPTION
+
+This script is give you content of the alert, acknowledgement, and request queues.
+There exist version for running as cronjob: monitor-queue.
+
+=head1 OPTIONS
+
+QUEUE
+ Name of notification queue. Should be ALERTS, ACKS or REQUESTS.
+
+WARNING_QUEUE_SIZE
+ Size of queue, which should produce warning. In cron we use 50.
+ If queue reach this limit. Script exit with code 1.
+
+CRITICAL_QUEUE_SIZE
+ Size of queue, which is critical. In cron we use 100.
+ If queue reach this limit, script exit with code 2.
+
+=head1 SEE ALSO
+
+monitor-queue(3)
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 2009--2010 Red Hat, Inc.
+Released under GNU General Public License, version 2 (GPLv2).
+
+=cut
commit 1430a68ebeb74542801ed60047cc8fe80352dae6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Sep 27 18:38:51 2010 +0200
636211 - include man page for monitor-queue
diff --git a/monitoring/NPalert/NPalert.spec b/monitoring/NPalert/NPalert.spec
index e93a576..044bbdb 100644
--- a/monitoring/NPalert/NPalert.spec
+++ b/monitoring/NPalert/NPalert.spec
@@ -91,6 +91,9 @@ install -p -m 644 httpd/templates/*.html $RPM_BUILD_ROOT%httpd_prefix/template
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/
install -p -m 644 cron/notification $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/notification
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3
+/usr/bin/pod2man $RPM_BUILD_ROOT/%{_bindir}/monitor-queue | gzip > $RPM_BUILD_ROOT%{_mandir}/man3/monitor-queue.3pm.gz
+
%post
if [ $1 -eq 2 ]; then
ls /opt/notification/config/generated/* 2>/dev/null | xargs -I file mv file %{_sysconfdir}/notification/generated
@@ -124,6 +127,7 @@ fi
%attr (755,%notif_user,%notif_user) %dir %log_dir/ticketlog
%attr(644,%notif_user,%notif_user) %{_sysconfdir}/notification/static/*
%{_sysconfdir}/notification/stage/config/static
+%{_mandir}/man3/monitor-queue*
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/monitoring/NPalert/scripts/monitor-queue b/monitoring/NPalert/scripts/monitor-queue
index 37ab28a..8382f52 100755
--- a/monitoring/NPalert/scripts/monitor-queue
+++ b/monitoring/NPalert/scripts/monitor-queue
@@ -7,8 +7,17 @@ use strict;
use NOCpulse::Config;
use NOCpulse::Gritch;
use NOCpulse::NOCpulseini;
+use Pod::Usage;
+
+pod2usage(0) unless $ARGV[0];
my $CFG=NOCpulse::Config->new;
+
+if (not $CFG) {
+ print "Error: /etc/NOCpulse.ini do not exist. Enable monitoring first.\n";
+ exit(1);
+}
+
my $recipient=$CFG->get('notification','notif_emergency_email');
my $queue_name=$ARGV[0];
@@ -45,3 +54,48 @@ if ($queue_size >= $CRITICAL_QUEUE_SIZE) {
print "$body\n";
$soapbox->gritch('Possible Notification Meltdown!!!',$body);
}
+
+=pod
+
+=head1 NAME
+
+monitor-queue - monitor the queues from Spacewalk monitoring.
+
+=head1 SYNOPSIS
+
+monitor-queue QUEUE WARNING_QUEUE_SIZE CRITICAL_QUEUE_SIZE
+
+=head1 DESCRIPTION
+
+This script is called by cron to monitor the alert, acknowledgement, and request queues.
+You should not execute it manually unless you know what are you doing. For standalone usage is intended
+executable queue_remote_check.pl
+
+This works independent from the notification system and uses SMTP to deliver warning messages.
+
+=head1 OPTIONS
+
+QUEUE
+ Name of notification queue. Should be ALERTS, ACKS or REQUESTS.
+
+WARNING_QUEUE_SIZE
+ Size of queue, which should produce warning. In cron we use 50.
+ Currently nothing happen, if queue reach this limit.
+
+CRITICAL_QUEUE_SIZE
+ Size of queue, which is critical. In cron we use 100.
+ If queue reach this limit, email is sent with subject
+ 'Possible Notification Meltdown!!!'
+ Email address is taken from NOCpulse.ini, from section notification, variable notif_emergency_email.
+
+=head1 SEE ALSO
+
+queue_remote_check.pl(3)
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 2010 Red Hat, Inc.
+Released under GNU General Public License, version 2 (GPLv2).
+
+=cut
+
13 years, 7 months
monitoring/PerlModules
by Miroslav Suchý
monitoring/PerlModules/NP/Probe/monitoring-data-cleanup | 21 ++++++----------
1 file changed, 8 insertions(+), 13 deletions(-)
New commits:
commit 7e78ef5648bfa19c1a56d290791e06e4beb536e9
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Sep 27 17:47:37 2010 +0200
636224 - fix typos in mange and output of --help
Output of --help option is now generated directly from POD using Pod::Usage
diff --git a/monitoring/PerlModules/NP/Probe/monitoring-data-cleanup b/monitoring/PerlModules/NP/Probe/monitoring-data-cleanup
index 9750605..da8556c 100755
--- a/monitoring/PerlModules/NP/Probe/monitoring-data-cleanup
+++ b/monitoring/PerlModules/NP/Probe/monitoring-data-cleanup
@@ -21,6 +21,7 @@ use PhysCluster;
use Date::Manip;
use Getopt::Long;
+use Pod::Usage;
#set the defaults
my $delete_unmatched = 1;
@@ -38,16 +39,8 @@ GetOptions(
"keep-monitoring-data:s" => \$delta,
"help" => \$help,
);
+pod2usage(0) if $help;
-if ($help) {
- print <<HELP;
-Usage:
- monitoring-data-cleanup --no-delete-unmatched
-
- monitoring-data-cleanup --keep-monitoring-data "1Y 6M"
-HELP
- exit;
-}
if ($dry_run) {
print "Warning: Dry run active - no changes will be made.\n";
}
@@ -159,21 +152,23 @@ monitoring-data-cleanup [OPTIONS]
=head1 DESCRIPTION
This script deletes data from monitoring probes older than given time frame.
-It can be useful to run from cron to periodicaly delete data which is not
+It can be useful to run from cron to periodically delete data which is not
interesting for you.
-Additionaly - in Spacewalk 0.5 and older we did not deletes data when probe
+Additionally - in Spacewalk 0.5 and older we did not deletes data when probe
has been deleted. And if you did not push scout configs you will be getting
data for deleted probes too. This script will delete them too.
=head1 OPTIONS
--dry-run
- No changes will be commited. All data will remain intact.
+ No changes will be committed. All data will remain intact.
--delete-unmatched
+ Delete data from probes, which have been already deleted. This is default.
+
--no-delete-unmatched
- Delete data from probes, which have been already deleted. Default is to delete them.
+ Do not delete data from probes, which have been already deleted. Default is to delete them.
--keep-monitoring-data DELTA
Delete data older than DELTA. Recognized deltas are of the form:
13 years, 7 months
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/postgres/procs/empty_blob.sql | 1
schema/spacewalk/postgres/procs/timestamp_minus_int.sql | 1
schema/spacewalk/postgres/tables/dual.sql | 2
schema/spacewalk/schema-source-sanity-check.pl | 54 +++++++++-------
4 files changed, 35 insertions(+), 23 deletions(-)
New commits:
commit 38e7f4f97f014c782744e642187151c89af35446
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Sep 27 16:35:25 2010 +0200
Marked PostgreSQL schema sources that are PostgreSQL-specific.
Also changed the sanity check script to report any such cases
as errors in the future.
diff --git a/schema/spacewalk/postgres/procs/empty_blob.sql b/schema/spacewalk/postgres/procs/empty_blob.sql
index 4af10bf..a308ae7 100644
--- a/schema/spacewalk/postgres/procs/empty_blob.sql
+++ b/schema/spacewalk/postgres/procs/empty_blob.sql
@@ -1,3 +1,4 @@
+-- oracle equivalent source none
--
-- Copyright (c) 2009 Red Hat, Inc.
--
diff --git a/schema/spacewalk/postgres/procs/timestamp_minus_int.sql b/schema/spacewalk/postgres/procs/timestamp_minus_int.sql
index 360bb2c..7e76f64 100644
--- a/schema/spacewalk/postgres/procs/timestamp_minus_int.sql
+++ b/schema/spacewalk/postgres/procs/timestamp_minus_int.sql
@@ -1,3 +1,4 @@
+-- oracle equivalent source none
--
-- Copyright (c) 2009 Red Hat, Inc.
--
diff --git a/schema/spacewalk/postgres/tables/dual.sql b/schema/spacewalk/postgres/tables/dual.sql
index 2f4afd9..fd93f11 100644
--- a/schema/spacewalk/postgres/tables/dual.sql
+++ b/schema/spacewalk/postgres/tables/dual.sql
@@ -1,3 +1,5 @@
+-- oracle equivalent source none
+
create table dual ( dummy char );
insert into dual values ( 'X' );
diff --git a/schema/spacewalk/schema-source-sanity-check.pl b/schema/spacewalk/schema-source-sanity-check.pl
index b33e422..48aeb9b 100644
--- a/schema/spacewalk/schema-source-sanity-check.pl
+++ b/schema/spacewalk/schema-source-sanity-check.pl
@@ -49,34 +49,42 @@ for my $c (sort keys %{ $files{oracle} }) {
for my $c (sort keys %{ $files{postgres} }) {
next unless $c =~ /\.sql$/;
- if (not exists $files{oracle}{$c}) {
- print "Postgres file [$c] is not in oracle (ignoring for now)\n" if $show_ignored;
- # $error = 1;
- } else {
- local *FILE;
- open FILE, "postgres/$c" or do {
- print "Error reading postgres/$c: $!\n";
+ local *FILE;
+ open FILE, "postgres/$c" or do {
+ print "Error reading postgres/$c: $!\n";
+ $error = 1;
+ next;
+ };
+ my $first_line = <FILE>;
+ close FILE;
+ if ($first_line =~ /^-- oracle equivalent source (?:(none)|sha1 ([0-9a-f]{40}))$/) {
+ my $oracle_sha1 = $2;
+ if (defined $1 and $1 eq 'none') {
+ # the PostgreSQL source says there is no Oracle equivalent
+ if (exists $files{oracle}{$c}) {
+ print "PostgreSQL file [$c] claims it has no Oracle equivalent, but it exists\n";
+ $error = 1;
+ }
+ next;
+ }
+ open FILE, "oracle/$c" or do {
+ print "Error reading oracle/$c to verify SHA1: $!\n";
$error = 1;
next;
};
- my $first_line = <FILE>;
+ my $sha1 = new Digest::SHA1;
+ $sha1->addfile(\*FILE);
+ my $sha1_hex = $sha1->hexdigest();
close FILE;
- if ($first_line =~ /^-- oracle equivalent source sha1 ([0-9a-f]{40})$/) {
- my $oracle_sha1 = $1;
- open FILE, "oracle/$c" or do {
- print "Error reading oracle/$c to verify SHA1: $!\n";
- $error = 1;
- next;
- };
- my $sha1 = new Digest::SHA1;
- $sha1->addfile(\*FILE);
- my $sha1_hex = $sha1->hexdigest();
- close FILE;
- if ($oracle_sha1 ne $sha1_hex) {
- print "File postgres/$c says SHA1 of Oracle source should be [$oracle_sha1] but it is [$sha1_hex]\n";
- $error = 1;
- }
+ if ($oracle_sha1 ne $sha1_hex) {
+ print "File postgres/$c says SHA1 of Oracle source should be [$oracle_sha1] but it is [$sha1_hex]\n";
+ $error = 1;
}
+ next;
+ }
+ if (not exists $files{oracle}{$c}) {
+ print "Postgres file [$c] is not in oracle\n";
+ $error = 1;
}
}
13 years, 7 months
schema/spacewalk
by Jan Pazdziora
schema/spacewalk/postgres/procs/adler32.sql | 74 ----------------------------
1 file changed, 74 deletions(-)
New commits:
commit 3a60fa85dff761ead03083d8d4f47ea56269ce97
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon Sep 27 16:16:48 2010 +0200
The adler32 function does not seem to be used, removing.
diff --git a/schema/spacewalk/postgres/procs/adler32.sql b/schema/spacewalk/postgres/procs/adler32.sql
deleted file mode 100644
index 6fa21f8..0000000
--- a/schema/spacewalk/postgres/procs/adler32.sql
+++ /dev/null
@@ -1,74 +0,0 @@
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
---
---
--- EXCLUDE: all
---
--- The Adler32 checksum from zlib
-
-CREATE OR REPLACE FUNCTION adler32(buf varchar, adler numeric)
- RETURNS numeric AS
-$$
-DECLARE
- s1 numeric;
- s2 numeric;
- signed boolean;
- currchar numeric;
- our_adler numeric;
- val1 int;
-begin
- -- Modulo 2**32 to protect ourselves
- --our_adler := mod(adler,4294967296);
- -- Postgres does not allow assigning values to arguements;
- -- replcing the value of adler by 1 where it's being used.
- --our_adler := mod(adler,4294967296);
- our_adler := mod(1,4294967296);
- if buf is null then
- return our_adler;
- end if;
- -- Oracle's bitwise and works on integers (which are signed and in
- -- the range -2**31..2**31)
- -- Any number above 2**31 would generate a numeric overflow
- -- Solution: substract 2**31 from the number, if the number is larger
- -- than 2**31 (this would clear the most significant bit)
- if our_adler > 2147483647 then
- -- our adler has bit 31 set
- -- take countermeasures: substract 2**31
- our_adler := our_adler - 2147483648;
- signed := true;
- else
- our_adler := our_adler;
- signed := false;
- end if;
-
- -- Extract the 16 least significant bits
- s1 := bitand(our_adler,65535);
- -- Extract the 15 most significant bits after we ignore the most
- -- significant bit (2**31 - 2**16)
- s2 := bitand(our_adler,2147418112) / 65536;
- if signed then
- -- Add the sign bit back as 2**15
- s2 := s2 + 32768;
- end if;
- for n in 1..length(buf) loop
- currchar := ascii(substr(buf,n,1));
- -- 65521 is the highest prime under 0xffff
- s1 := mod((s1+currchar), 65521);
- s2 := mod((s2 + s1), 65521);
- end loop;
- return s2 * 65536 + s1;
-end;
-$$ LANGUAGE 'plpgsql' STABLE;
-
13 years, 7 months
spacecmd/src
by aparsons
spacecmd/src/lib/softwarechannel.py | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
New commits:
commit 7c9af21cd3063b958a917efbc84627c0f3333247
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Mon Sep 27 10:13:53 2010 -0400
spacecmd: don't use mergeErrataWithPackages API
diff --git a/spacecmd/src/lib/softwarechannel.py b/spacecmd/src/lib/softwarechannel.py
index 9b1dfbd..b475366 100644
--- a/spacecmd/src/lib/softwarechannel.py
+++ b/spacecmd/src/lib/softwarechannel.py
@@ -821,18 +821,18 @@ def do_softwarechannel_adderrata(self, args):
if not self.user_confirm('Add these errata and packages [y/N]:'): return
if self.check_api_version('10.12'):
- merged = \
- self.client.channel.software.mergeErrataWithPackages(self.session,
- source_channel,
- dest_channel,
- errata)
+ merged = self.client.channel.software.mergeErrata(self.session,
+ source_channel,
+ dest_channel,
+ errata)
# show the user which errata were actually merged
- print
- print "Errata Merged"
- print "-------------"
- print
- print_errata_list(merged)
+ if self.options.debug:
+ print
+ print "Errata Merged"
+ print "-------------"
+ print
+ print_errata_list(merged)
else:
# clone each erratum individually because the process is slow and it can
# lead to timeouts on the server
@@ -840,11 +840,11 @@ def do_softwarechannel_adderrata(self, args):
logging.debug('Cloning %s' % erratum)
self.client.errata.clone(self.session, dest_channel, [erratum])
- # add the affected packages to the channel
- logging.info('Adding required packages to %s' % dest_channel)
- self.client.channel.software.addPackages(self.session,
- dest_channel,
- package_ids)
+ # add the affected packages to the channel
+ logging.info('Adding required packages to %s' % dest_channel)
+ self.client.channel.software.addPackages(self.session,
+ dest_channel,
+ package_ids)
# regenerate the errata cache since we just cloned errata
self.generate_errata_cache(True)
13 years, 7 months
java/code
by aparsons
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 115 ----------
1 file changed, 8 insertions(+), 107 deletions(-)
New commits:
commit 11ed84d2410fe2b1e3410f0a3c28f0db9630e627
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Mon Sep 27 09:44:51 2010 -0400
Revert "591291 - added new API calls channel.software.mergeErrataWithPackages"
This reverts commit aecf408bd48b53e672560c1daa2dcf3257d5e90b.
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index 0cf38f7..74979bd 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -1826,12 +1826,6 @@ public class ChannelSoftwareHandler extends BaseHandler {
*/
public Object[] mergeErrata(String sessionKey, String mergeFromLabel,
String mergeToLabel) {
- return mergeErrata(sessionKey, mergeFromLabel, mergeToLabel, false);
- }
-
- private Object[] mergeErrata(String sessionKey, String mergeFromLabel,
- String mergeToLabel, boolean addPackages) {
-
User loggedInUser = getLoggedInUser(sessionKey);
channelAdminPermCheck(loggedInUser);
@@ -1844,7 +1838,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
Set<Errata> mergedErrata =
mergeErrataToChannel(loggedInUser, new HashSet(mergeFrom.getErratas()),
- mergeTo, mergeFrom, addPackages);
+ mergeTo, mergeFrom);
return mergedErrata.toArray();
}
@@ -1874,13 +1868,6 @@ public class ChannelSoftwareHandler extends BaseHandler {
*/
public Object[] mergeErrata(String sessionKey, String mergeFromLabel,
String mergeToLabel, String startDate, String endDate) {
- return mergeErrata(sessionKey, mergeFromLabel, mergeToLabel,
- startDate, endDate, false);
- }
-
- private Object[] mergeErrata(String sessionKey, String mergeFromLabel,
- String mergeToLabel, String startDate, String endDate, boolean addPackages) {
-
User loggedInUser = getLoggedInUser(sessionKey);
channelAdminPermCheck(loggedInUser);
@@ -1895,75 +1882,20 @@ public class ChannelSoftwareHandler extends BaseHandler {
loggedInUser.getOrg(), mergeFrom, startDate, endDate);
Set<Errata> mergedErrata =
- mergeErrataToChannel(loggedInUser, new HashSet(fromErrata),
- mergeTo, mergeFrom, addPackages);
+ mergeErrataToChannel(loggedInUser, new HashSet(fromErrata), mergeTo, mergeFrom);
return mergedErrata.toArray();
}
/**
- * Merge a channel's errata into another channel and adds the packages
- * @param sessionKey session of the user
- * @param mergeFromLabel the label of the channel to pull the errata from
- * @param mergeToLabel the label of the channel to push errata into
- * @return A list of errata that were merged.
- *
- * @xmlrpc.doc Merges all errata from one channel into another and adds the packages
- * @xmlrpc.param #session_key()
- * @xmlrpc.param #param_desc("string", "mergeFromLabel", "the label of the
- * channel to pull errata from")
- * @xmlrpc.param #param_desc("string", "mergeToLabel", "the label to push the
- * errata into")
- * @xmlrpc.returntype
- * #array()
- * $ErrataSerializer
- * #array_end()
- */
- public Object[] mergeErrataWithPackages(String sessionKey, String mergeFromLabel,
- String mergeToLabel) {
- return mergeErrata(sessionKey, mergeFromLabel, mergeToLabel, true);
- }
-
- /**
- * Merge a channel's errata into another channel
- * based upon a given start/end date and add the packages
- * @param sessionKey session of the user
- * @param mergeFromLabel the label of the channel to pull the errata from
- * @param mergeToLabel the label of the channel to push errata into
- * @param startDate begin date
- * @param endDate end date
- * @return A list of errata that were merged.
- *
- * @xmlrpc.doc Merges all errata from one channel into another based upon a
- * given start/end date.
- * @xmlrpc.param #session_key()
- * @xmlrpc.param #param_desc("string", "mergeFromLabel", "the label of the
- * channel to pull errata from")
- * @xmlrpc.param #param_desc("string", "mergeToLabel", "the label to push the
- * errata into")
- * @xmlrpc.param #param("string", "startDate")
- * @xmlrpc.param #param("string", "endDate")
- * @xmlrpc.returntype
- * #array()
- * $ErrataSerializer
- * #array_end()
- */
- public Object[] mergeErrataWithPackages(String sessionKey, String mergeFromLabel,
- String mergeToLabel, String startDate, String endDate) {
- return mergeErrata(sessionKey, mergeFromLabel,
- mergeToLabel, startDate, endDate, true);
- }
-
- /**
- * Merge a list of errata from one channel into another channel and adds the packages
+ * Merge a list of errata from one channel into another channel
* @param sessionKey session of the user
* @param mergeFromLabel the label of the channel to pull the errata from
* @param mergeToLabel the label of the channel to push errata into
* @param errataNames the list of errata to merge
* @return A list of errata that were merged.
*
- * @xmlrpc.doc Merges a list of errata from one channel into another and
- * adds the affected packages to the destination channel
+ * @xmlrpc.doc Merges a list of errata from one channel into another
* @xmlrpc.param #session_key()
* @xmlrpc.param #param_desc("string", "mergeFromLabel", "the label of the
* channel to pull errata from")
@@ -1976,7 +1908,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
* $ErrataSerializer
* #array_end()
*/
- public Object[] mergeErrataWithPackages(String sessionKey, String mergeFromLabel,
+ public Object[] mergeErrata(String sessionKey, String mergeFromLabel,
String mergeToLabel, List errataNames) {
User loggedInUser = getLoggedInUser(sessionKey);
@@ -2005,13 +1937,13 @@ public class ChannelSoftwareHandler extends BaseHandler {
}
Set<Errata> mergedErrata =
- mergeErrataToChannel(loggedInUser, errataToMerge, mergeTo, mergeFrom, true);
+ mergeErrataToChannel(loggedInUser, errataToMerge, mergeTo, mergeFrom);
return mergedErrata.toArray();
}
private Set<Errata> mergeErrataToChannel(User user, Set<Errata> errataToMerge,
- Channel toChannel, Channel fromChannel, boolean addPackages) {
+ Channel toChannel, Channel fromChannel) {
// find errata that we do not need to merge
List<Errata> same = ErrataManager.listSamePublishedInChannels(
@@ -2028,38 +1960,7 @@ public class ChannelSoftwareHandler extends BaseHandler {
ErrataManager.publishErrataToChannelAsync(toChannel,
getErrataIds(errataToMerge), user);
- // add packages to the channel if requested
- if (addPackages) {
- List<Long> packagesToAdd = new ArrayList();
-
- List<Long> fromChannelPkgs = ChannelFactory.getPackageIds(fromChannel.getId());
-
- for (Errata erratum : errataToMerge) {
- Set<Package> erratumPackageList = erratum.getPackages();
-
- for (Package pkg : erratumPackageList) {
- // if the package is in the source channel, add it to the destination
- if (fromChannelPkgs.contains(pkg.getId())) {
- packagesToAdd.add(pkg.getId());
- }
- }
- }
-
- // add the packages to the destination channel
- ChannelManager.addPackages(toChannel, packagesToAdd, user);
-
- // refresh the channel
- ChannelManager.refreshWithNewestPackages(toChannel, "api");
-
- // Mark the affected channel to have it's metadata evaluated, where necessary
- // (RHEL5+, mostly)
- ChannelManager.queueChannelChange(toChannel.getLabel(),
- "java::mergeErrataToChannel", user.getLogin());
-
- List<Long> cids = new ArrayList();
- cids.add(toChannel.getId());
- ErrataCacheManager.insertCacheForChannelPackagesAsync(cids, packagesToAdd);
- }
+ // no need to regenerate errata cache, because we didn't touch any packages
return errataToMerge;
}
13 years, 7 months