web/modules/rhn/RHN/DB/AppInstall/Session.pm | 36 ----------
web/modules/rhn/RHN/DB/Channel.pm | 72 --------------------
web/modules/rhn/RHN/DB/Kickstart.pm | 32 ---------
web/modules/rhn/RHN/DB/Kickstart/Session.pm | 22 ------
web/modules/rhn/RHN/DB/Org.pm | 25 -------
web/modules/rhn/RHN/DB/Package.pm | 7 -
web/modules/rhn/RHN/DB/Server.pm | 95 ---------------------------
web/modules/rhn/RHN/DB/User.pm | 40 -----------
web/modules/rhn/RHN/Entitlements.pm | 34 ---------
9 files changed, 363 deletions(-)
New commits:
commit 219a90cae1bb630b1dbc5d3e01d6a51741aeb669
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:36:11 2010 +0100
Removing %feature_universe and %excluded_features which are used only once.
diff --git a/web/modules/rhn/RHN/Entitlements.pm b/web/modules/rhn/RHN/Entitlements.pm
index 73b8301..535d074 100644
--- a/web/modules/rhn/RHN/Entitlements.pm
+++ b/web/modules/rhn/RHN/Entitlements.pm
@@ -40,11 +40,6 @@ my %monitoring_features = map { $_ => 1 }
my %nonlinux_features = map { $_ => 1 }
qw/ftr_nonlinux_support/;
-# all features are the unique features in other FOO_features arrays
-my %feature_universe = (%updates_features, %management_features,
- %provisioning_features, %nonlinux_features,
- %monitoring_features);
-
my %entitlement_feature_map =
( none => { },
sw_mgr_entitled => { map { $_ => 1 } (keys %updates_features) },
@@ -62,10 +57,6 @@ my %entitlement_feature_map =
keys %nonlinux_features) },
);
-my %excluded_features = (nonlinux_entitled => { map { $_ => 1 }
- qw/ftr_errata_updates ftr_proxy_capable ftr_sat_capable ftr_reboot
- ftr_kickstart ftr_delta_action/ });
-
# What type of feature is this? Management, provisioning, monitoring, etc.
sub feature_type {
my $class = shift;
commit b92c71012f61aef3414f8ac4b4ce10cc1408d8db
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:33:13 2010 +0100
entitlement_grants_service not used, removing.
diff --git a/web/modules/rhn/RHN/Entitlements.pm b/web/modules/rhn/RHN/Entitlements.pm
index 37d126e..73b8301 100644
--- a/web/modules/rhn/RHN/Entitlements.pm
+++ b/web/modules/rhn/RHN/Entitlements.pm
@@ -66,31 +66,6 @@ my %excluded_features = (nonlinux_entitled => { map { $_ => 1 }
qw/ftr_errata_updates ftr_proxy_capable ftr_sat_capable ftr_reboot
ftr_kickstart ftr_delta_action/ });
-my %grant_map =
- ( none => [ ],
- sw_mgr_entitled => [ 'updates' ],
- enterprise_entitled => [ 'updates', 'management',
'monitoring' ],
- provisioning_entitled => [ 'updates', 'management',
'provisioning', 'monitoring' ],
- monitoring_entitled => [ 'monitoring' ],
- nonlinux_entitled => [ 'updates', 'management',
'provisioning', 'nonlinux' ]
- );
-my %valid_services = map { $_ => 1 } qw/updates management provisioning monitoring
nonlinux/;
-
-sub entitlement_grants_service { # Need to refactor Tokens to remove this entirely
- my $class = shift;
- my $entitlement = shift;
- my $desired_service = shift;
-
- return 0 unless defined $desired_service and defined $entitlement;
-
- croak "Invalid entitlement type '$entitlement'" unless exists
$grant_map{$entitlement};
- croak "Invalid service level '$desired_service'" unless exists
$valid_services{$desired_service};
-
- return 1 if grep { $_ eq $desired_service } @{$grant_map{$entitlement}};
-
- return 0;
-}
-
# What type of feature is this? Management, provisioning, monitoring, etc.
sub feature_type {
my $class = shift;
commit 823fbd276bda19471515f31f3c2639f37e073b1b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:30:49 2010 +0100
Removal of Sniglets::Inspector (its disable_user_toggle_cb) made disable_user and
enable_user unused, removing, as well as _change_user_state.
diff --git a/web/modules/rhn/RHN/DB/User.pm b/web/modules/rhn/RHN/DB/User.pm
index 501f883..d6193da 100644
--- a/web/modules/rhn/RHN/DB/User.pm
+++ b/web/modules/rhn/RHN/DB/User.pm
@@ -211,46 +211,6 @@ EOQ
}
-sub _change_user_state {
- my $self = shift;
- my $doer_id = shift;
- my $state_label = shift;
-
- my $transaction = shift;
-
- my $dbh = $transaction || RHN::DB->connect();
-
- my $query = <<EOQ;
-INSERT INTO rhnWebContactChangelog (id, web_contact_id, web_contact_from_id,
change_state_id)
-SELECT rhn_wcon_disabled_seq.nextval, :target_id, :doer_id, id
- FROM rhnWebContactChangeState
- WHERE label = :state_label
-EOQ
-
- my $sth = $dbh->prepare($query);
- $sth->execute_h(target_id => $self->id, doer_id => $doer_id, state_label
=> $state_label);
-
- unless ($transaction) {
- $dbh->commit;
- }
-
- return $transaction;
-}
-
-sub disable_user {
- my $self = shift;
- my $doer_id = shift;
-
- return $self->_change_user_state($doer_id, 'disabled');
-}
-
-sub enable_user {
- my $self = shift;
- my $doer_id = shift;
-
- return $self->_change_user_state($doer_id, 'enabled');
-}
-
sub delete_user {
my $class = shift;
commit 4dedf5330d316113e07a9f58de59fd544c2cca11
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:25:59 2010 +0100
satellite_cert is not called, removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 00e4d61..1ab7c33 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -2994,12 +2994,4 @@ EOQ
}
-sub satellite_cert {
- my $self = shift;
- if (@_) {
- $self->{__cert__} = shift;
- }
- return $self->{__cert__};
-}
-
1;
commit 4380d2b2457b8c086d8554089c1e9f93538e68e1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:24:50 2010 +0100
Removal of base_entitlement_box made can_switch_base_entitlement unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 2c66a04..00e4d61 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -1785,38 +1785,6 @@ sub can_entitle_server {
return $can ? 1 : 0;
}
-sub can_switch_base_entitlement {
- my $self_or_class = shift;
- my $entitlement = shift;
-
- my $sid;
- if (ref $self_or_class) {
- $sid = $self_or_class->id;
- }
- else {
- $sid = shift;
- }
-
- my $dbh = RHN::DB->connect;
- my $can = 0;
-
- eval {
- $can = $dbh->call_function('rhn_entitlements.can_switch_base', $sid,
$entitlement);
- };
-
- if ($@) {
- my $E = $@;
-
- # if it's anything other not function not returning a value, toss
- # the exception further up the chain...
- unless ($E =~ m/ORA-06503/) {
- throw $E;
- }
- }
-
- return $can ? 1 : 0;
-}
-
sub set_channels {
my $self = shift;
my %params = validate(@_, {user_id => 1, channels => 1});
commit 9114215a7cb6bab81c61e14a20db0d570aa84a5b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:23:36 2010 +0100
deactivate_satellite is not called, removing.
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index f4174cc..2c66a04 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -727,61 +727,6 @@ EOQ
return $dbh;
}
-sub deactivate_satellite {
- my $self = shift;
- my $transaction = shift;
- my $dbh = $transaction || RHN::DB->connect();
- my $query;
- my $sth;
-
- $query = <<EOQ;
-DELETE FROM rhnSatelliteInfo
- WHERE server_id = ?
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- $query = <<EOQ;
-DELETE FROM rhnSatelliteChannelFamily
- WHERE server_id = ?
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- # actually unsubscribe from any satellite channels...
- $query = <<EOQ;
-DECLARE
-
- cursor subscribed_sat_channels(server_id_in in number) is
- SELECT DISTINCT SC.channel_id AS ID
- FROM rhnServerChannel SC, rhnChannelFamilyMembers CFM, rhnChannelFamily CF
- WHERE SC.server_id = server_id_in
- AND CF.label = 'rhn-satellite'
- AND CF.id = CFM.channel_family_id
- AND CFM.channel_id = SC.channel_id;
-
-BEGIN
-
- for subscribed_chan in subscribed_sat_channels(:server_id) loop
- rhn_channel.unsubscribe_server(:server_id, subscribed_chan.id);
- end loop;
-END;
-EOQ
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(server_id => $self->id);
-
-
- $dbh->commit unless $transaction;
-
- delete $self->{__satellite_server_id__};
- delete $self->{__satellite_cert__};
-
- return $dbh;
-}
-
sub base_channel_id {
my $self = shift;
commit b92de672a33df0ce0bf08fffd02d0d19626a6618
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:20:42 2010 +0100
create_package does not seem to be used, removing.
diff --git a/web/modules/rhn/RHN/DB/Package.pm b/web/modules/rhn/RHN/DB/Package.pm
index 1fb338e..7e068ac 100644
--- a/web/modules/rhn/RHN/DB/Package.pm
+++ b/web/modules/rhn/RHN/DB/Package.pm
@@ -526,13 +526,6 @@ sub blank_package {
bless { }, shift;
}
-sub create_package {
- my $class = shift;
- my $package = $class->blank_package;
- $package->{__id__} = -1;
- return $package;
-}
-
sub arch_fields {
return @arch_fields;
}
commit b2e4afd799101a69be1169aaff36f4a80601baae
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:19:08 2010 +0100
Removal of find_responsible_user made org_admins unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Org.pm b/web/modules/rhn/RHN/DB/Org.pm
index 5174fb3..a4039fb 100644
--- a/web/modules/rhn/RHN/DB/Org.pm
+++ b/web/modules/rhn/RHN/DB/Org.pm
@@ -463,31 +463,6 @@ EOQ
return 0;
}
-sub org_admins {
- my $self = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOS);
-SELECT ugm.user_id
- FROM rhnUserGroupMembers ugm,
- web_contact wc
- WHERE ugm.user_group_id = (SELECT id
- FROM rhnUserGroup
- WHERE org_id = ?
- AND group_type = (SELECT id FROM rhnUserGroupType WHERE
label = 'org_admin'))
- AND wc.id = ugm.user_id
-ORDER BY wc.id
-EOS
- $sth->execute($self->id);
-
- my @ret;
- while (my ($id) = $sth->fetchrow) {
- push @ret, $id;
- }
-
- return @ret;
-}
-
sub entitled_satellite_families {
my $self = shift;
commit 58d16dd0a44af9e0659d3d4a3f6b289b2de79316
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:16:45 2010 +0100
Removal of mark_failed made current_server (and thus new_server and old_server)
unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Kickstart/Session.pm
b/web/modules/rhn/RHN/DB/Kickstart/Session.pm
index b4dee17..4bbd615 100644
--- a/web/modules/rhn/RHN/DB/Kickstart/Session.pm
+++ b/web/modules/rhn/RHN/DB/Kickstart/Session.pm
@@ -310,28 +310,6 @@ sub activation_keys {
return @tokens;
}
-sub old_server {
- my $self = shift;
-
- my $sid = $self->old_server_id;
-
- return $sid ? RHN::Server->lookup(-id => $sid) : undef;
-}
-
-sub new_server {
- my $self = shift;
-
- my $sid = $self->new_server_id;
-
- return $sid ? RHN::Server->lookup(-id => $sid) : undef;
-}
-
-sub current_server {
- my $self = shift;
-
- return ($self->new_server || $self->old_server);
-}
-
sub kstree {
my $self = shift;
commit e616f3949ce384f5fab33eb642eec347e33110cd
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:05:50 2010 +0100
get_channel_arch is not used, removing; also removing default_tree which is called
from get_channel_arch.
diff --git a/web/modules/rhn/RHN/DB/Kickstart.pm b/web/modules/rhn/RHN/DB/Kickstart.pm
index 59720b8..de97640 100644
--- a/web/modules/rhn/RHN/DB/Kickstart.pm
+++ b/web/modules/rhn/RHN/DB/Kickstart.pm
@@ -895,38 +895,6 @@ EOQ
return @{$data};
}
-sub default_tree {
- my $self = shift;
-
- my $kstree_id = $self->default_kstree_id;
-
- if ($kstree_id) {
- return RHN::KSTree->lookup(-id => $kstree_id);
- }
-
- return;
-}
-sub get_channel_arch {
- my $self = shift;
-
- my $channel_id = $self->default_tree->channel_id;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-SELECT CA.label
- FROM rhnChannel C, rhnChannelArch CA
- WHERE 1=1
- AND C.id = :cid
- AND C.channel_arch_id = CA.id
-EOQ
-
- $sth->execute_h(cid => $channel_id);
-
- my $row = $sth->fetchrow_hashref;
- $sth->finish;
-
- return $row->{'LABEL'};
-}
sub org_ks_ip_ranges {
my $class = shift;
commit caadf000b654f502a332f0a3395715de0ec26238
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:12:54 2010 +0100
Removal of get_rhn_kickstart_package made latest_package_equal unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index 1a895b8..309d399 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -1135,24 +1135,6 @@ EOQ
return ($pid, $path);
}
-sub latest_package_equal {
- my $class = shift;
- my $cid = shift;
- my $name = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-SELECT CP.package_id
- FROM rhnPackageName PN, rhnChannelNewestPackage CP
- WHERE CP.channel_id = :cid
- AND CP.name_id = PN.id
- AND PN.name = :name
-EOQ
-
- $sth->execute_h(cid => $cid, name => $name);
- return map { @$_ } $sth->fullfetch;
-}
-
sub packaging_type {
my $class_or_self = shift;
commit 7812c69e7bd3c3f00d92af87a90d12a0476bbe32
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:12:00 2010 +0100
Removal of get_rhn_extras_channel made latest_package_like unused, removing.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index 49ca269..1a895b8 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -1135,24 +1135,6 @@ EOQ
return ($pid, $path);
}
-sub latest_package_like {
- my $class = shift;
- my $cid = shift;
- my $name = shift;
-
- my $dbh = RHN::DB->connect;
- my $sth = $dbh->prepare(<<EOQ);
-SELECT CP.package_id
- FROM rhnPackageName PN, rhnChannelNewestPackage CP
- WHERE CP.channel_id = :cid
- AND CP.name_id = PN.id
- AND PN.name LIKE :namelike
-EOQ
-
- $sth->execute_h(cid => $cid, namelike => '%' . $name . '%');
- return map { @$_ } $sth->fullfetch;
-}
-
sub latest_package_equal {
my $class = shift;
my $cid = shift;
commit 35bf6be8906087b09fe221400a592f770f57525e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 23:10:26 2010 +0100
available_entitlements and installable are not used, removing; also removing
installable_path.
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index 4403efa..49ca269 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -370,25 +370,6 @@ EOQ
return @ret;
}
-sub available_entitlements {
- my $class = shift;
- my %params = validate(@_, {org_id => 1, channel_id => 1});
-
- my $dbh = RHN::DB->connect;
- my $query;
- my $sth;
-
- $query = "SELECT rhn_channel.available_chan_subscriptions(:channel_id, :org_id)
FROM DUAL";
-
- $sth = $dbh->prepare($query);
- $sth->execute_h(org_id => $params{org_id}, channel_id =>
$params{channel_id});
-
- my ($count) = $sth->fetchrow;
- $sth->finish;
-
- return $count;
-}
-
sub has_downloads {
my $class = shift;
my $cid = shift;
@@ -1129,23 +1110,6 @@ EOQ
return;
}
-# XXX: hack; for now, rely on filesystem presence. later, store this
-# info in the database
-
-sub installable_path {
- my $self = shift;
-
- return "rhn/kickstart/" . $self->label;
-}
-
-sub installable {
- my $self = shift;
-
- my $path = File::Spec->catfile(PXT::Config->get('kickstart_mount_point'),
$self->installable_path);
-
- return -d $path;
-}
-
sub package_by_filename_in_tree {
my $self = shift;
my $filename = shift;
commit 2c50ade1507bf5c06e4630da66e7ca3acd8714f0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Jan 5 22:59:43 2010 +0100
get_user_id, set_user_id, get_server_id, and set_server_id do not seem to be used,
removing.
diff --git a/web/modules/rhn/RHN/DB/AppInstall/Session.pm
b/web/modules/rhn/RHN/DB/AppInstall/Session.pm
index 25b300c..1940f3b 100644
--- a/web/modules/rhn/RHN/DB/AppInstall/Session.pm
+++ b/web/modules/rhn/RHN/DB/AppInstall/Session.pm
@@ -470,40 +470,4 @@ foreach my $field (keys %valid_fields) {
}
}
-sub get_user_id {
- my $self = shift;
-
- return $self->get_user->id()
-}
-
-sub set_user_id {
- my $self = shift;
- my $id = shift;
-
- my $user = RHN::User->lookup(-id => $id);
-
- $self->set_user($user);
- $self->{":modified:"}->{user_id} = 1;
-
- return;
-}
-
-sub get_server_id {
- my $self = shift;
-
- return $self->get_server->id()
-}
-
-sub set_server_id {
- my $self = shift;
- my $id = shift;
-
- my $server = RHN::Server->lookup(-id => $id);
-
- $self->set_server($server);
- $self->{":modified:"}->{server_id} = 1;
-
- return;
-}
-
1;