web/modules/rhn/RHN/DB/Action.pm | 14 -
web/modules/rhn/RHN/DB/ChannelEditor.pm | 27 --
web/modules/rhn/RHN/DB/Downloads.pm | 94 -------
web/modules/rhn/RHN/DB/Kickstart/Session.pm | 78 -----
web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm | 317 ------------------------
web/modules/rhn/RHN/DB/Probe.pm | 54 ----
web/modules/rhn/RHN/DB/Profile.pm | 134 ----------
web/modules/rhn/RHN/DB/SatCluster.pm | 13
web/modules/rhn/RHN/DB/ServerActions.pm | 18 -
web/modules/rhn/RHN/DB/TableClass.pm | 37 --
web/modules/rhn/RHN/DB/TemplateString.pm | 25 -
web/modules/rhn/RHN/DB/TinyURL.pm | 41 ---
web/modules/rhn/RHN/MonitoringConfigMacro.pm | 47 ---
web/modules/rhn/RHN/TokenGen/Local.pm | 3
web/spacewalk-web.spec | 3
15 files changed, 905 deletions(-)
New commits:
commit a8de1044838c6a68b82db228afc12f91b0b1225f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:51:29 2010 +0100
Removal of mark_failed made delete_systems_from_action unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Action.pm b/web/modules/rhn/RHN/DB/Action.pm
index 0dc0e0b..a23d56f 100644
--- a/web/modules/rhn/RHN/DB/Action.pm
+++ b/web/modules/rhn/RHN/DB/Action.pm
@@ -199,20 +199,6 @@ EOQ
}
}
-sub delete_systems_from_action {
- my $class = shift;
- my $aid = shift;
- my @systems = @_;
-
- my $dbh = RHN::DB->connect;
-
- foreach my $sid (@systems) {
- $dbh->call_procedure('rhn_server.remove_action', $sid, $aid);
- }
-
- $dbh->commit;
-}
-
sub delete_set_from_action {
my $class = shift;
commit 8ba2f77d5bd6b997da5bb34c68f96d2dcba35fef
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:50:17 2010 +0100
Removal of get_tiny_url made tinify_path unused, removing.
diff --git a/web/modules/rhn/RHN/DB/TinyURL.pm b/web/modules/rhn/RHN/DB/TinyURL.pm
index c3f141a..1fabbd8 100644
--- a/web/modules/rhn/RHN/DB/TinyURL.pm
+++ b/web/modules/rhn/RHN/DB/TinyURL.pm
@@ -92,29 +92,4 @@ sub random_url_string {
return $result;
}
-# Take a (local-to-this-server) path and return a tiny url for it and
-# the token string.
-sub tinify_path {
- my $class = shift;
- my %params = validate(@_, { path => 1,
- expiration => 0,
- scheme => { default => 'http' },
- host => 0,
- } );
-
- $params{host} ||= PXT::Config->get('base_domain');
-
- throw "(invalid_url_scheme) $params{scheme} should be 'http' or
'https'"
- unless (grep { $_ eq $params{scheme} } qw/http https/);
-
- my $token = $class->create($params{path}, $params{expiration});
-
- my $tiny_url = new URI::URL;
- $tiny_url->scheme($params{scheme});
- $tiny_url->host($params{host});
- $tiny_url->path('/ty/' . $token);
-
- return ($tiny_url->as_string, $token);
-}
-
1;
commit e778d5e7b747568e219dedc28b6139fe8e7e73d5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:49:03 2010 +0100
Removing bunch of unused methods from RHN::DB::Kickstart::Session:
get_tiny_url
fail_inprogress
mark_failed
set_history_message
last_history_event
diff --git a/web/modules/rhn/RHN/DB/Kickstart/Session.pm
b/web/modules/rhn/RHN/DB/Kickstart/Session.pm
index 8c56423..b4dee17 100644
--- a/web/modules/rhn/RHN/DB/Kickstart/Session.pm
+++ b/web/modules/rhn/RHN/DB/Kickstart/Session.pm
@@ -269,39 +269,6 @@ sub get_url {
return $url;
}
-sub get_tiny_url {
- my $self = shift;
- my %params = validate(@_, { expected_time => 0 });
-
- my $url = $self->get_url;
- my $host = $self->system_rhn_host;
-
- my ($tu, $token) =
- RHN::TinyURL->tinify_path(-path => $url->full_path,
- -host => $host,
- -expiration => $params{expected_time});
-
- return ($tu, $token);
-}
-
-sub fail_inprogress {
- my $class = shift;
- my %params = validate(@_, {org_id => 1, sid => 1});
-
- my $ds = new RHN::DataSource::General(-mode =>
'kickstart_sessions_for_system');
- my $data = $ds->execute_full(-sid => $params{sid});
-
- foreach my $row (@{$data}) {
- next if (grep { $row->{STATE_LABEL} eq $_ } qw/failed complete/);
- next if ($row->{NEW_SERVER_ID} and $row->{NEW_SERVER_ID} != $params{sid});
-
- my $session = $class->lookup(-id => $row->{ID});
- $session->mark_failed('A new kickstart session was initiated for this
system.');
- }
-
- return;
-}
-
sub action {
my $self = shift;
@@ -343,30 +310,6 @@ sub activation_keys {
return @tokens;
}
-sub mark_failed {
- my $self = shift;
- my $message = shift;
-
- my $action = $self->action;
-
- if ($action) {
-
- while ($action->prerequisite) {
- $action = $action->prerequisite_action;
- }
-
- if ($self->current_server) {
- RHN::Action->delete_systems_from_action($action->id,
$self->current_server->id);
- }
- }
-
- $self->update_state('failed');
- $self->action_id('');
- $self->commit;
-
- $self->set_history_message($message) if $message;
-}
-
sub old_server {
my $self = shift;
@@ -397,25 +340,4 @@ sub kstree {
return RHN::KSTree->lookup(-id => $self->kstree_id);
}
-sub set_history_message {
- my $self = shift;
- my $message = shift;
-
- my $dbh = RHN::DB->connect;
-
- $dbh->call_procedure("set_ks_session_history_message", $self->id,
$self->session_state_label, $message);
- $dbh->commit;
-
- return;
-}
-
-sub last_history_event {
- my $self = shift;
-
- my $ds = new RHN::DataSource::Simple(-querybase => 'General_queries', -mode
=> 'kickstart_session_history');
- my $data = $ds->execute_query(-kssid => $self->id);
-
- return $data->[-1];
-}
-
1;
commit 4a31fefab3a31de381806d322bc8deaf882e8c0f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:47:10 2010 +0100
None of the (remaining) three functions is used, making RHN::DB::Downloads obsolete,
removing.
diff --git a/web/modules/rhn/RHN/DB/Downloads.pm b/web/modules/rhn/RHN/DB/Downloads.pm
deleted file mode 100644
index cd30bf8..0000000
--- a/web/modules/rhn/RHN/DB/Downloads.pm
+++ /dev/null
@@ -1,94 +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.
-#
-
-package RHN::DB::Downloads;
-
-use strict;
-use RHN::DB;
-use Params::Validate;
-Params::Validate::validation_options(strip_leading => "-");
-
-sub record_download {
- my $class = shift;
- my %params = validate(@_, { file_id => 1, location => 1, token => 1, ip =>
1, user_id => 1 });
-
- my $dbh = RHN::DB->connect();
- my $sth = $dbh->prepare(<<EOQ);
-INSERT INTO rhnFileDownload
- (file_id, location, token, requestor_ip, start_time, user_id)
-VALUES
- (:file_id, :location, :token, :ip, sysdate, :user_id)
-EOQ
- $sth->execute_h(map { $_ => $params{$_} } keys %params);
- $dbh->commit;
-}
-
-# bump the order of a given category up in the list
-sub bump_channel_category {
- my $class = shift;
- my %params = validate(@_, { channel_id => 1, category => 1 });
-
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare(<<EOQ);
-SELECT 1
- FROM rhnDownloads D
- WHERE D.id IN (SELECT CD.downloads_id
- FROM rhnChannelDownloads CD
- WHERE CD.channel_id = :cid)
- AND D.category = :category
-EOQ
-
- $sth->execute_h(cid => $params{channel_id}, category => $params{category});
- my ($row) = $sth->fetchrow;
-
- unless ($row) {
- die sprintf('Could not find a category named "%s" for channel id
"%d"',
- $params{category}, $params{channel_id});
- }
-
- $sth = $dbh->prepare(<<EOQ);
-UPDATE rhnDownloads D
- SET D.ordering = D.ordering + 50
- WHERE D.id IN (SELECT CD.downloads_id
- FROM rhnChannelDownloads CD
- WHERE CD.channel_id = :cid)
- AND NOT D.category = :category
-EOQ
-
- $sth->execute_h(cid => $params{channel_id}, category => $params{category});
- $dbh->commit;
-
- return;
-}
-
-sub get_file_id {
- my $class = shift;
- my $file_path = shift;
-
- my $dbh = RHN::DB->connect();
-
- my $sth = $dbh->prepare(<<EOQ);
-SELECT id FROM rhnFile WHERE path = :file_path
-EOQ
-
- $sth->execute_h(file_path => $file_path);
- my ($file_id) = $sth->fetchrow;
- $sth->finish;
-
- return $file_id;
-}
-
-1;
diff --git a/web/modules/rhn/RHN/TokenGen/Local.pm
b/web/modules/rhn/RHN/TokenGen/Local.pm
index a3c1472..e0c13bd 100644
--- a/web/modules/rhn/RHN/TokenGen/Local.pm
+++ b/web/modules/rhn/RHN/TokenGen/Local.pm
@@ -16,14 +16,11 @@
package RHN::TokenGen::Local;
use strict;
-use RHN::DB::Downloads;
use URI::URL;
use PXT::Utils;
use PXT::Config;
-our @ISA = qw/RHN::DB::Downloads/;
-
use Params::Validate;
Params::Validate::validation_options(strip_leading => "-");
commit beff100b5f246c2e33f850f10f8710aefe6f4ee8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:43:04 2010 +0100
Removing bunch of unused methods from RHN::DB::Profile:
compatible_servers_in_set
compatible_servers
package_info_for_match_action
create_from_profile
remove_packages_by_id_combo
diff --git a/web/modules/rhn/RHN/DB/Profile.pm b/web/modules/rhn/RHN/DB/Profile.pm
index 5bdfae1..1cbff0e 100644
--- a/web/modules/rhn/RHN/DB/Profile.pm
+++ b/web/modules/rhn/RHN/DB/Profile.pm
@@ -159,63 +159,6 @@ sub commit {
delete $self->{":modified:"};
}
-sub compatible_servers_in_set {
- my $self = shift;
- my $user_id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query = <<EOQ;
-SELECT S.id,
- S.name
- FROM rhnServer S
- WHERE S.org_id = ?
- AND S.id IN (SELECT element FROM rhnSet WHERE user_id = ? AND label =
'system_list')
- AND EXISTS (SELECT 1
- FROM rhnServerChannel SC
- WHERE SC.server_id = S.id
- AND SC.channel_id = ?)
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->org_id, $user_id, $self->base_channel);
-
- my @ret;
- while (my @data = $sth->fetchrow) {
- push @ret, [ @data ];
- }
-
- return @ret;
-}
-
-
-sub compatible_servers {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query = <<EOQ;
-SELECT S.id,
- S.name
- FROM rhnServer S
- WHERE S.org_id = ?
- AND EXISTS (SELECT 1
- FROM rhnServerChannel SC
- WHERE SC.server_id = S.id
- AND SC.channel_id = ?)
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->org_id, $self->base_channel);
-
- my @ret;
- while (my @data = $sth->fetchrow) {
- push @ret, [ @data ];
- }
-
- return @ret;
-}
-
sub copy_from {
my $self = shift;
my %params = validate(@_, { sid => 0, prid => 0, transaction => 0 });
@@ -267,42 +210,6 @@ EOQ
$dbh->commit unless $params{transaction};
}
-sub package_info_for_match_action {
- my $class = shift;
- my %params = @_;
-
- my ($action_id, $lower, $upper, $total_ref) =
- map { $params{"-" . $_} } qw/action_id lower upper total_rows/;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOS);
-SELECT PN.name || '-' || PE.evr.as_vre_simple(), AP.parameter
- FROM rhnPackageName PN,
- rhnPackageEVR PE,
- rhnActionPackage AP
- WHERE AP.action_id = ?
- AND AP.name_id = PN.id
- AND AP.evr_id = PE.id
-ORDER BY upper(PN.name), PE.evr, AP.parameter
-EOS
- $sth->execute($action_id);
-
- $$total_ref = 0;
-
- my @result;
- my $i = 1;
- while (my @data = $sth->fetchrow) {
- $$total_ref = $i;
-
- if ($i >= $lower and $i <= $upper) {
- push @result, [ @data ];
- }
- $i++;
- }
- $sth->finish;
- return @result;
-}
-
sub compatible_with_server {
my $class = shift;
my $server_id = shift;
@@ -445,47 +352,6 @@ sub create_from_system {
return $profile;
}
-sub create_from_profile {
- my $class = shift;
- my %params = validate(@_, { prid => 1, org_id => 1, name => 1, description
=> 1, type => 1, transaction => 0 });
-
- my $old_profile = RHN::Profile->lookup(-id => $params{prid});
- my $profile = RHN::Profile->create;
-
- $profile->org_id($params{org_id});
-
- $profile->base_channel($old_profile->base_channel);
- $profile->name($params{name});
- $profile->description($params{description});
- $profile->set_profile_type($params{type});
-
- $profile->commit($params{transaction});
- $profile->copy_from(-prid => $params{prid}, -transaction =>
$params{transaction});
-
- return $profile;
-}
-
-sub remove_packages_by_id_combo {
- my $self = shift;
- my @id_combos = @_;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-DELETE
- FROM rhnServerProfilePackage SPP
- WHERE SPP.server_profile_id = :id
- AND SPP.name_id = :name_id
- AND SPP.evr_id = :evr_id
-EOQ
-
- foreach my $combo (@id_combos) {
- my ($name_id, $evr_id) = split /\|/, $combo;
- $sth->execute_h(id => $self->id, evr_id => $evr_id, name_id =>
$name_id);
- }
-
- $dbh->commit;
-}
-
# goofy, but useful
sub base_channel_id {
my $self = shift;
commit 4bff54343ba87928adb921df11ef451af7283b6f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:40:31 2010 +0100
update_query_lob and insert_query_lob not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/TableClass.pm b/web/modules/rhn/RHN/DB/TableClass.pm
index b42cae7..ebfd4b7 100644
--- a/web/modules/rhn/RHN/DB/TableClass.pm
+++ b/web/modules/rhn/RHN/DB/TableClass.pm
@@ -156,43 +156,6 @@ sub insert_query {
return $ret;
}
-sub update_query_lob {
- my $self = shift;
- my %changed_fields = map { $_ => 1 } @_;
-
- return '' unless grep { exists $changed_fields{$_} } $self->column_names;
-
- my $ret;
- my $n = 0;
-
- $ret .= "UPDATE $self->{name} $self->{alias}\nSET ";
- $ret .= join(", ", map { $n++; "$_ = " .
$self->type_to_placeholder($_, ":q$n") }
- grep { exists $changed_fields{$_} } map { "$_" }
$self->column_names);
-
- $ret .= "\nWHERE ";
-
- return $ret;
-}
-
-sub insert_query_lob {
- my $self = shift;
- my %changed_fields = map { $_ => 1 } @_;
-
- return '' unless grep { exists $changed_fields{$_} } $self->column_names;
-
- my $ret;
- my $n = 0;
-
- $ret .= "INSERT INTO $self->{name} $self->{alias}\n (";
- $ret .= join(", ", grep { exists $changed_fields{$_} }
$self->column_names);
- $ret .= ") VALUES (";
- $ret .= join(", ", map { $n++; $self->type_to_placeholder($_,
":q$n") }
- grep { exists $changed_fields{$_} } map { "$_" }
$self->column_names);
- $ret .= ")";
-
- return $ret;
-}
-
sub column_names {
my $self = shift;
commit 2968db6b908ac1849327e4d7801343a623cbb542
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:40:03 2010 +0100
change_set_base_channel not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/ServerActions.pm
b/web/modules/rhn/RHN/DB/ServerActions.pm
index 8bb24ed..79de043 100644
--- a/web/modules/rhn/RHN/DB/ServerActions.pm
+++ b/web/modules/rhn/RHN/DB/ServerActions.pm
@@ -174,22 +174,4 @@ EOQ
return $dbh;
}
-sub change_set_base_channel {
- my $class = shift;
- my $set = shift;
- my $channel_id = shift;
-
- my $query = <<EOQ;
-BEGIN
- rhn_channel.bulk_server_base_change(?, ?, ?);
-END;
-EOQ
-
- my $dbh = RHN::DB->connect();
- my $sth = $dbh->prepare($query);
- $sth->execute($channel_id, $set->label, $set->uid);
-
- $dbh->commit;
-}
-
1;
commit 56a365bed47edb01132383e562d44ad16ba98e2d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:38:31 2010 +0100
Removal of RHN::MonitoringConfigMacro made RHN::DB::MonitoringConfigMacro unused,
removing.
diff --git a/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
b/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
deleted file mode 100644
index 4987671..0000000
--- a/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
+++ /dev/null
@@ -1,210 +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.
-#
-
-package RHN::DB::MonitoringConfigMacro;
-
-use strict;
-use Carp;
-use Data::Dumper;
-use RHN::DataSource::Simple;
-use RHN::DB;
-
-our $VERSION = (split(/s+/, q$Id$, 4))[2];
-
-
-# Generated getter/setter methods (per Chip)
-{
-
- my @fields = qw(
- name definition description environment
- last_update_user last_update_date
- );
-
- my $tmpl = q|
- sub [[field]] {
- my $self = shift;
- if (@_) {
- $self->{__[[field]]__} = shift;
- }
- return $self->{__[[field]]__};
- };
- |;
-
- foreach my $field (@fields) {
-
- (my $sub = $tmpl) =~ s/\[\[field\]\]/$field/g;
-
- eval $sub;
-
- croak $@ if($@);
- }
-
-}
-
-
-#########
-sub new {
-#########
- my $class = shift;
- my %args = @_;
- my $self = {};
- bless($self, $class);
-
- foreach my $arg (keys %args) {
- $self->$arg($args{$arg});
- }
-
- return $self;
-}
-
-
-##########################
-sub load_editable_macros {
-##########################
- my $class = shift;
- my @macros;
-
- my $data = RHN::DataSource::Simple->new(
- -querybase => 'probe_queries',
- -mode => 'editable_config_macros',
- )->execute_full();
-
- foreach my $record (@$data) {
- my $macro = $class->new();
- foreach my $field (keys %$record) {
- my $meth = lc($field);
- my $value = defined($record->{$field}) ? $record->{$field} : '';
- $macro->$meth($value);
- }
- push(@macros, $macro);
- }
-
- return \@macros;
-}
-
-############
-sub update {
-############
- my $self = shift;
- my $login = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $sql = q{
- UPDATE rhn_config_macro
- SET definition = :definition,
- last_update_user = :luser,
- last_update_date = sysdate
- WHERE name = :name
- AND environment = :environment
- };
-
- my $sth = $dbh->prepare($sql);
- $sth->execute_h(
- definition => $self->definition,
- name => $self->name,
- environment => $self->environment,
- luser => $login,
- );
-
-}
-
-
-1;
-
-
-__END__
-=head1 NAME
-
-RHN::DB::MonitoringConfigMacro - Monitoring commands
-
-=head1 SYNOPSIS
-
- use RHN::DB::MonitoringConfigMacro;
-
- my $macros = RHN::DB::MonitoringConfigMacro->load_editable_macros();
-
- my $macro = $macros->[0];
- $macro->definition($new_definition);
- $macro->update($username);
-
-=head1 DESCRIPTION
-
-RHN::DB::MonitoringConfigMacro provides access to RHN monitoring
-configuration macros (the RHN_CONFIG_MACRO table).
-
-=head1 CLASS METHODS
-
-=over 8
-
-=item new()
-
-Construct a new RHN::DB::MonitoringConfigMacro object.
-
-=item load_editable_macros()
-
-Loads editable macros from the database.
-
-=back
-
-=head1 INSTANCE METHODS
-
-=over 8
-
-=item update($username)
-
-Updates a changed macro in the database. $username will be recorded
-as the last person to edit the macro.
-
-=back
-
-=head1 INSTANCE VARIABLES
-
-=over 8
-
-=item name()
-
-The macro name.
-
-=item definition()
-
-The macro definition. Macros may refer to other macros using
-%{MACRONAME} syntax.
-
-=item description()
-
-The human-readable macro description.
-
-=item environment()
-
-The environment for which the macro is intended.
-
-=item last_update_user()
-
-The last person to update the macro.
-
-=item last_update_date()
-
-The last time the macro was updated.
-
-=back
-
-=head1 COPYRIGHT
-
-Copyright (c) 2004-2005, Red Hat, Inc. All rights reserved
-
-=cut
-
-
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index 3bfa31d..fd0aae5 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -218,7 +218,6 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/RHN::DB::Command.3pm.gz
%{_mandir}/man3/RHN::DB::ContactGroup.3pm.gz
%{_mandir}/man3/RHN::DB::ContactMethod.3pm.gz
-%{_mandir}/man3/RHN::DB::MonitoringConfigMacro.3pm.gz
%{_mandir}/man3/RHN::DB::Probe.3pm.gz
%{_mandir}/man3/RHN::DB::SatCluster.3pm.gz
%{_mandir}/man3/RHN::DB::SatNode.3pm.gz
commit 01260b5badc70fb85de4bf583e6d5feb6d898a3d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:37:46 2010 +0100
Removal of Sniglets::MonitoringConfig made RHN::MonitoringConfigMacro unused,
removing.
diff --git a/web/modules/rhn/RHN/MonitoringConfigMacro.pm
b/web/modules/rhn/RHN/MonitoringConfigMacro.pm
deleted file mode 100644
index 110fcf3..0000000
--- a/web/modules/rhn/RHN/MonitoringConfigMacro.pm
+++ /dev/null
@@ -1,47 +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.
-#
-
-use strict;
-
-package RHN::MonitoringConfigMacro;
-
-use RHN::DB::MonitoringConfigMacro;
-
-our @ISA = qw/RHN::DB::MonitoringConfigMacro/;
-
-
-
-1;
-
-__END__
-=head1 NAME
-
-RHN::MonitoringConfigMacro - Wrapper class for RHN::DB::MonitoringConfigMacro
-
-=head1 DESCRIPTION
-
-Wrapper class for RHN::DB::MonitoringConfigMacro. This wrapper
-decorates RHN::DB::MonitoringConfigMacro with methods that provide a
-more intuitive API to some of the underlying data.
-
-=head1 SEE ALSO
-
-L<RHN::DB::MonitoringConfigMacro>
-
-=head1 COPYRIGHT
-
-Copyright (c) 2004-2005, Red Hat, Inc. All rights reserved
-
-=cut
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index c60a656..3bfa31d 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -177,7 +177,6 @@ rm -rf $RPM_BUILD_ROOT
%{perl_vendorlib}/RHN/Kickstart/
%{perl_vendorlib}/RHN/Mail.pm
%{perl_vendorlib}/RHN/Manifest.pm
-%{perl_vendorlib}/RHN/MonitoringConfigMacro.pm
%{perl_vendorlib}/RHN/Org.pm
%{perl_vendorlib}/RHN/Package.pm
%{perl_vendorlib}/RHN/Package/
@@ -224,7 +223,6 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man3/RHN::DB::SatCluster.3pm.gz
%{_mandir}/man3/RHN::DB::SatNode.3pm.gz
%{_mandir}/man3/RHN::DB::ServerGroup.3pm.gz
-%{_mandir}/man3/RHN::MonitoringConfigMacro.3pm.gz
%{_mandir}/man3/RHN::Probe.3pm.gz
%{_mandir}/man3/RHN::SCDB.3pm.gz
%{_mandir}/man3/RHN::SatCluster.3pm.gz
commit de1a7c080df2c6c3bc7e655676931f3a588b7fcc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:35:07 2010 +0100
are_notifications_squelched, squelch_notifications, and unsquelch_notifications not
called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
b/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
index 840e38b..4987671 100644
--- a/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
+++ b/web/modules/rhn/RHN/DB/MonitoringConfigMacro.pm
@@ -54,113 +54,6 @@ our $VERSION = (split(/s+/, q$Id$, 4))[2];
}
-# this is a horrid place for this function, but I don't think
-# there is a better spot for right now... :/
-sub are_notifications_squelched {
- my $class = shift;
-
- my $sql = q{
-SELECT recid
- FROM redirects
- WHERE redirect_type = 'BLACKHOLE'
- AND description = 'Global Squelch'
- AND reason = 'Someone turned off all notifications via the website'
- };
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare($sql);
- $sth->execute;
-
- my ($am_squelched) = $sth->fetchrow;
- $sth->finish;
-
- return $am_squelched;
-}
-
-# this is a pretty sucky "off" switch. :(
-sub squelch_notifications {
- my $class = shift;
- my $user = shift;
-
- my $dbh = RHN::DB->connect;
-
-my $sql = <<EOP;
-DECLARE
-
-redirect_id number;
-
-cursor contacts is
-SELECT recid
- FROM rhn_contact_monitoring;
-
-BEGIN
-for contact in contacts loop
- select rhn_redirects_recid_seq.nextval into redirect_id from dual;
-
- insert into redirects (
- recid,
- customer_id,
- contact_id,
- redirect_type,
- description,
- reason,
- start_date,
- expiration,
- last_update_user,
- last_update_date
- ) values (
- redirect_id,
- :org_id,
- contact.recid,
- 'BLACKHOLE',
- 'Global Squelch',
- 'Someone turned off all notifications via the website',
- sysdate,
- sysdate + (365 * 10),
- :user_login,
- sysdate
- );
-
- insert into redirect_criteria (
- recid,
- redirect_id,
- match_param,
- match_value
- )
- values (
- redirect_criteria_recid_seq.nextval,
- redirect_id,
- 'CUSTOMER_ID',
- :org_id
- );
-end loop;
-END;
-EOP
-
- my $sth = $dbh->prepare($sql);
- $sth->execute_h(org_id => $user->org_id,
- user_login => $user->login,
- );
- $dbh->commit;
-}
-
-sub unsquelch_notifications {
- my $class = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $sql = q{
-DELETE FROM redirects
- WHERE redirect_type = 'BLACKHOLE'
- AND description = 'Global Squelch'
- AND reason = 'Someone turned off all notifications via the website'
- };
-
- my $sth = $dbh->prepare($sql);
- $sth->execute;
- $dbh->commit;
-}
-
#########
sub new {
#########
commit 94b7085620f2d1a4b9956acfb6a4456638cfb5b0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:34:08 2010 +0100
channel_edit_list not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/ChannelEditor.pm
b/web/modules/rhn/RHN/DB/ChannelEditor.pm
index d84a281..5ea0bff 100644
--- a/web/modules/rhn/RHN/DB/ChannelEditor.pm
+++ b/web/modules/rhn/RHN/DB/ChannelEditor.pm
@@ -63,33 +63,6 @@ EOS
}
-sub channel_edit_list {
- my $class = shift;
- my $org_id = shift;
-
- my $dbh = RHN::DB->connect;
-
- my $query;
- my $sth;
-
- $query = <<EOQ;
-SELECT AC.channel_name, AC.channel_id, AC.channel_depth, AC.channel_arch_id
- FROM rhnAvailableChannels AC
- WHERE AC.org_id = ?
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($org_id);
-
- my @channels;
-
- while (my @row = $sth->fetchrow) {
- push @channels, [ @row ];
- }
-
- return @channels;
-}
-
sub channel_base_arch_map {
my $self = shift;
commit 231a3511a177f47310bce9b2fffc0a136569b4b1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:33:03 2010 +0100
list_scouts_by_org not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/SatCluster.pm b/web/modules/rhn/RHN/DB/SatCluster.pm
index d5f1975..9822dbf 100644
--- a/web/modules/rhn/RHN/DB/SatCluster.pm
+++ b/web/modules/rhn/RHN/DB/SatCluster.pm
@@ -310,19 +310,6 @@ sub lookup {
}
-########################
-sub list_scouts_by_org {
-########################
- my $self = shift;
- my $org_id = shift;
-
- my $ds = new RHN::DataSource::Simple(-querybase => 'scout_queries',
- -mode => 'scouts_for_org');
-
- return $ds->execute_query(-org_id => $org_id);
-
-}
-
#################
sub push_config {
#################
commit 4e53215e5cea8e648ac88c59ff8a757055bb3db6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:31:25 2010 +0100
lookup_consume not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/TinyURL.pm b/web/modules/rhn/RHN/DB/TinyURL.pm
index 9beb625..c3f141a 100644
--- a/web/modules/rhn/RHN/DB/TinyURL.pm
+++ b/web/modules/rhn/RHN/DB/TinyURL.pm
@@ -46,22 +46,6 @@ EOS
return $result;
}
-sub lookup_consume {
- my $class = shift;
- my %params = validate(@_, {token => 1});
- my $token = $params{token};
-
- my $ret = $class->lookup(-token => $token);
- if ($ret) {
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare("UPDATE rhnTinyURL SET enabled = 'N' WHERE
token = :token");
- $sth->execute_h(token => $token);
- $dbh->commit;
- }
-
- return $ret;
-}
-
sub create {
my $class = shift;
my $url = shift;
commit 9995ad33a5a2c79e6d1f71fbd375e23a6d9e364b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:30:54 2010 +0100
delete_probe and scout_for_probe not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/Probe.pm b/web/modules/rhn/RHN/DB/Probe.pm
index 1609666..2008a8c 100644
--- a/web/modules/rhn/RHN/DB/Probe.pm
+++ b/web/modules/rhn/RHN/DB/Probe.pm
@@ -295,50 +295,6 @@ sub list_scouts {
return $ds->execute_query(-customer_id => $customer_id);
}
-##################
-sub delete_probe {
-##################
- my $class = shift;
-
- my $dbh = RHN::DB->connect;
- my ($sth, $query);
- my $probe_id = $class->{__recid__};
-
- $query = <<EOQ;
-DELETE FROM rhn_probe
- WHERE recid = :probe_id
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(probe_id => $probe_id);
- $dbh->commit;
-}
-
-
-#####################
-sub scout_for_probe {
-#####################
- my $class = shift;
- my $probe_id = shift;
-
- my $dbh = RHN::DB->connect;
- my ($sth, $query);
-
- $query = <<EOF;
-SELECT SC.description
- FROM sat_cluster SC, check_probe CP
- WHERE CP.probe_id = :probe_id
- AND CP.sat_cluster_id = SC.recid
-EOF
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(probe_id => $probe_id);
- my $scout_description = $sth->fetchrow;
-
- return $scout_description;
-}
-
-
1;
@@ -376,16 +332,6 @@ Look up probe by probe ID
-=item scout_for_probe(probe_id)
-
-Use this method to find the description of the monitoring scout on
-which probe_id is configured to run.
-
-EXAMPLE:
-
-my $scout_description = $probe->scout_for_probe($probe_id);
-$form->add_widget( new RHN::Form::Widget::Literal(name => 'Monitoring
Scout', value => $scout_description) );
-
=back
=head1 SEE ALSO
commit ae9c107fd50aa10b101453e75dd6cfdc77861e26
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 17:29:23 2010 +0100
get_category_id and create_template_string not called from anywhere, removing.
diff --git a/web/modules/rhn/RHN/DB/TemplateString.pm
b/web/modules/rhn/RHN/DB/TemplateString.pm
index f897117..8a1b892 100644
--- a/web/modules/rhn/RHN/DB/TemplateString.pm
+++ b/web/modules/rhn/RHN/DB/TemplateString.pm
@@ -89,31 +89,6 @@ sub lookup {
return $ret;
}
-sub get_category_id {
- my $class = shift;
- my $label = shift;
- die "no label!" unless ($label);
-
- my $dbh = RHN::DB->connect;
-
- my $sth = $dbh->prepare("SELECT id FROM rhnTemplateCategory WHERE label =
:label");
- $sth->execute_h(label => $label);
-
- my ($value) = $sth->fetchrow;
- $sth->finish;
-
- return $value;
-}
-
-sub create_template_string {
- my $class = shift;
-
- my $template = $class->_blank_templatestring();
- $template->{__id__} = -1;
-
- return $template;
-}
-
sub _blank_templatestring {
my $class = shift;