rel-eng/packages schema/spacewalk
by Michael Mraka
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 9c3478225ac3a7999d6c330917ab0059dc9faf44
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 31 12:06:55 2010 +0200
Automatic commit of package [spacewalk-schema] release [1.1.2-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index cbdd72a..f7737e0 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.1.1-1 schema/spacewalk/
+1.1.2-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 12d7d56..84c6662 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.1.1
+Version: 1.1.2
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -58,6 +58,12 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-schema-upgrade*
%changelog
+* Mon May 31 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.2-1
+- none of rhnDumpSnapshot* exists anymore
+- 585965 - adding upgrade schema for bug
+- 585965 - fixing issue with multilib packages and errata-cache generation
+- Fix ORA-02429 error during schema upgrade
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.1-1
- bumping spec files to 1.1 packages
12 years, 1 month
Changes to 'refs/tags/spacewalk-web-1.1.2-1'
by Michael Mraka
Tag 'spacewalk-web-1.1.2-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-05-31 10:02 +0000
Tagging package [spacewalk-web] version [1.1.2-1] in directory [web/].
Changes since spacewalk-backend-1.1.17-1:
Michael Mraka (1):
Automatic commit of package [spacewalk-web] release [1.1.2-1].
---
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
---
12 years, 1 month
rel-eng/packages web/spacewalk-web.spec
by Michael Mraka
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 9a65e564c0e1ea63da189070a4a9181cdb8980ea
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 31 12:02:06 2010 +0200
Automatic commit of package [spacewalk-web] release [1.1.2-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index 41858a0..ea16ebe 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-1.1.1-1 web/
+1.1.2-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index a84c127..1d5814f 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.1.1
+Version: 1.1.2
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -256,6 +256,14 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Mon May 31 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.2-1
+- 577355 - fixing broken link on channel->errata->clone screen
+- Setting server.nls_lang once, later in this file, should be enough.
+- code cleanup - this configuration files are not used in proxy
+- Removing web/conf/*.conf files that are not packages nor used.
+- bump version for spacewalk 1.1
+- Fixed a couple of links with respect to the delete confirm change..
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.1-1
- bumping spec files to 1.1 packages
- Constants DEFAULT_RHN_SATCON_TREE and DEFAULT_SATCON_DICT not longer used
12 years, 1 month
Branch 'flex-guest' - schema/spacewalk web/html web/modules
by Partha Aji
schema/spacewalk/oracle/packages/rhn_channel.pkb | 17 ---
schema/spacewalk/oracle/packages/rhn_channel.pks | 3
schema/spacewalk/postgres/packages/rhn_channel.pkb | 29 ------
web/html/network/software/channels/license.pxt | 45 ----------
web/html/network/systems/ssm/channels/index.pxt | 79 -----------------
web/html/network/systems/ssm/channels/license.pxt | 60 -------------
web/modules/rhn/RHN/DB/ServerActions.pm | 42 ---------
web/modules/sniglets/Sniglets/Channel.pm | 68 ---------------
web/modules/sniglets/Sniglets/ListView/SystemList.pm | 84 -------------------
9 files changed, 427 deletions(-)
New commits:
commit 43d4eef4de901377bb61075fdbf44f3aed371d0d
Author: Partha Aji <paji(a)redhat.com>
Date: Fri May 28 19:09:01 2010 -0400
Removed the bulk-subscribe and unsubscribe which is not used anywhere
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pkb b/schema/spacewalk/oracle/packages/rhn_channel.pkb
index 925dddd..f5d5c96 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pkb
@@ -240,15 +240,6 @@ IS
end;
- PROCEDURE bulk_subscribe_server(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER)
- IS
- BEGIN
- FOR server IN rhn_set.set_iterator(set_label_in, set_uid_in)
- LOOP
- rhn_channel.subscribe_server(server.element, channel_id_in, 0, set_uid_in);
- END LOOP server;
- END bulk_subscribe_server;
-
PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER)
IS
BEGIN
@@ -606,14 +597,6 @@ IS
end if;
END unsubscribe_server;
- PROCEDURE bulk_unsubscribe_server(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER)
- IS
- BEGIN
- FOR server IN rhn_set.set_iterator(set_label_in, set_uid_in)
- LOOP
- rhn_channel.unsubscribe_server(server.element, channel_id_in, 0);
- END LOOP server;
- END bulk_unsubscribe_server;
FUNCTION family_for_channel(channel_id_in IN NUMBER)
RETURN NUMBER
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pks b/schema/spacewalk/oracle/packages/rhn_channel.pks
index a6de86d..2036f9a 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pks
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pks
@@ -72,9 +72,6 @@ IS
FUNCTION channel_priority(channel_id_in in number) RETURN number;
- PROCEDURE bulk_subscribe_server(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER);
- PROCEDURE bulk_unsubscribe_server(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER);
-
PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER);
procedure bulk_server_basechange_from(
set_label_in in varchar2,
diff --git a/schema/spacewalk/postgres/packages/rhn_channel.pkb b/schema/spacewalk/postgres/packages/rhn_channel.pkb
index be74ba0..09f78f9 100644
--- a/schema/spacewalk/postgres/packages/rhn_channel.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_channel.pkb
@@ -218,20 +218,6 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
end$$ language plpgsql;
- CREATE OR REPLACE FUNCTION bulk_subscribe_server(channel_id_in IN NUMERIC, set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void
- AS $$
- DECLARE
- server RECORD;
- BEGIN
- FOR server IN
- SELECT user_id, label, element, element_two
- FROM rhnSet
- WHERE label = set_label_in
- AND user_id = set_uid_in
- LOOP
- perform rhn_channel.subscribe_server(server.element, channel_id_in, 0, set_uid_in);
- END LOOP;
- END$$ language plpgsql;
CREATE OR REPLACE FUNCTION bulk_server_base_change(channel_id_in IN NUMERIC, set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void
AS $$
@@ -643,21 +629,6 @@ update pg_settings set setting = 'rhn_channel,' || setting where name = 'search_
perform rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
END$$ language plpgsql;
- CREATE OR REPLACE FUNCTION bulk_unsubscribe_server(channel_id_in IN NUMERIC, set_label_in IN VARCHAR, set_uid_in IN NUMERIC) returns void
- AS $$
- DECLARE
- server RECORD;
- BEGIN
- FOR server IN
- SELECT user_id, label, element, element_two
- FROM rhnSet
- WHERE label = set_label_in
- AND user_id = set_uid_in
- LOOP
- perform rhn_channel.unsubscribe_server(server.element, channel_id_in, 0);
- END LOOP;
- END$$ language plpgsql;
-
CREATE OR REPLACE FUNCTION family_for_channel(channel_id_in IN NUMERIC)
RETURNS NUMERIC
AS $$
diff --git a/web/html/network/software/channels/license.pxt b/web/html/network/software/channels/license.pxt
deleted file mode 100644
index 2e4e7ee..0000000
--- a/web/html/network/software/channels/license.pxt
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::Channel" />
- <pxt-use class="Sniglets::ChannelLicense" />
- <pxt-use class="Sniglets::Users" />
- <pxt-use class="Sniglets::HTML" />
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
-<rhn-channel-details>
- <h1><img src="/img/rhn-icon-channels.gif" /> {channel_name} <rhn-help href="s1-sm-channels-packages.jsp" /></h1>
-</rhn-channel-details>
-
- <rhn-navi-nav prefix="channel_details" depth="0" file="/nav/channel_detail.xml" style="contentnav" />
-
- <h2>End User License Agreement</h2>
-
-<rhn-channel-license-dialog>
- <div class="page-summary">
- <p>Please read and accept the following End User Licensing Agreement (EULA) to subscribe the selected systems to this channel.</p>
- <br />
- <pre>{channel_license}</pre>
- <br />
- </div>
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
- <pxt-form method="POST">
- <div align="right">
- <hr />
- <input type="submit" name="cancel" value="Cancel" />
- <input type="submit" name="accept" value="Accept" />
- <input type="hidden" name="pxt:trap" value="rhn:channel_license_dialog_cb" />
- <input type="hidden" name="cdc" value="1" />
- <input type="hidden" name="subscribe_to" value="{channel_id}" />
- {additional_channels}
- <pxt-hidden name="cid" />
- <pxt-hidden name="set_label" />
- </div>
- </pxt-form>
-</rhn-channel-license-dialog>
-
- </grail-canvas-template>
-</pxt-passthrough>
diff --git a/web/html/network/systems/ssm/channels/index.pxt b/web/html/network/systems/ssm/channels/index.pxt
deleted file mode 100644
index 78139b7..0000000
--- a/web/html/network/systems/ssm/channels/index.pxt
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::ListUtils" />
- <pxt-use class="Sniglets::Channel" />
- <pxt-use class="Sniglets::HTML" />
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
- <h1><img src="/img/rhn-icon-system_group.gif" alt="system set" /> System Set Manager <rhn-help href="s1-sm-systems.jsp#s2-sm-ssm" /></h1>
-
- <rhn-navi-nav prefix="system_set_manager" depth="0" file="/nav/ssm.xml" style="contentnav" />
-
-
-<h2>Channel Subscriptions</h2>
-
- <div class="page-summary">
- <p>
- Below is a list of channels in your organization.
- </p>
- <ul>
- <li>To subscribe selected systems to a channel, check Subscribe for that channel.</li>
- <li>To unsubscribe selected systems from a channel, check Unsubscribe for that channel.</li>
- <li>Check No Change to leave the selected systems unaffected relative to that channel.</li>
- </ul>
- <p>
- <strong>Note:</strong> attempts to assign a system to an incompatible channel will fail.
- </p>
- </div>
-
-<rhn-resubscribe-warning-ssm>
-<div class="resubscribe-warning-big">
-<p>
- <img src="/img/rhn-icon-warning.gif" title="Resubscription Warning" /> You do not have subscription rights to the marked channels below. You will not be able to resubscribe any systems to such channels without administrator intervention.
-</p>
-</div>
-</rhn-resubscribe-warning-ssm>
-
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
-<rhn-fix-list list_type="channel">
-<empty_list_mesg>No relevant channels</empty_list_mesg>
-
-<pxt-form method="post" action="/network/systems/ssm/channels/alter_subscriptions_conf.pxt">
-
-<table width="96%" cellspacing="0" cellpadding="0" class="list" align="center">
- <thead>
- <tr>
- <th>Channel</th>
- <th>Subscribe</th>
- <th>Unsubscribe</th>
- <th>No Change</th>
- </tr>
- </thead>
-<rhn-tri-state-channel-list>
- <tr class="{class}">
- <td class="first-column">{channel_name}</td>
- <td align="center">{subscribe_column}</td>
- <td align="center"><input type="radio" name="{channel_id}" value="unsubscribe" /></td>
- <td class="last-column" align="center"><input type="radio" name="{channel_id}" value="do_nothing" checked="1" /></td>
- </tr>
-</rhn-tri-state-channel-list>
-</table>
-
-<input type="hidden" name="pxt:trap" value="rhn:sscd_alter_channel_membership_cb" />
-
-<div align="right">
-<hr />
-<input type="submit" name="channel_actions" value="Alter Subscriptions" />
-</div>
-
-</pxt-form>
-</rhn-fix-list>
-
-
- </grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/html/network/systems/ssm/channels/license.pxt b/web/html/network/systems/ssm/channels/license.pxt
deleted file mode 100644
index 3d4872b..0000000
--- a/web/html/network/systems/ssm/channels/license.pxt
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::ChannelLicense" />
- <pxt-use class="Sniglets::Lists" />
- <pxt-use class="Sniglets::HTML" />
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
- <h1><img src="/img/rhn-icon-system_group.gif" alt="system set" /> System Set Manager <rhn-help href="s1-sm-systems.jsp#s2-sm-ssm" /></h1>
-
- <rhn-navi-nav prefix="system_set_manager" depth="0"
- file="/nav/ssm.xml" style="contentnav" />
-
-
-<h2>End User License Agreement</h2>
-
-<rhn-channel-license-dialog>
-<p><strong>{channel_name}</strong></p>
-
-<p>You must agree to the following EULA before you may subscribe the systems listed at the bottom of the page:</p>
-
-<br />
-
-<pre>{channel_license}</pre>
-
-<br />
-
-
-<rhn-listview class="Sniglets::ListView::SystemList"
-mode="target_systems_for_channel_in_set">
- <formvar>
- <var>cid</var>
- <var>additional_channel</var>
- </formvar>
- <column name="Name" label="server_name" align="left" />
-</rhn-listview>
-
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
-<pxt-form method="POST">
-<div align="right">
-<hr />
-<input type="submit" name="cancel" value="Cancel" />
-<input type="submit" name="accept" value="Accept" />
-</div>
-
-<input type="hidden" name="pxt:trap" value="rhn:channel_license_dialog_cb" />
-
-<input type="hidden" name="cid" value="{channel_id}" />
-{additional_channels}
-
-<input type="hidden" name="ssm" value="1" />
-</pxt-form>
-</rhn-channel-license-dialog>
-
-</grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/modules/rhn/RHN/DB/ServerActions.pm b/web/modules/rhn/RHN/DB/ServerActions.pm
index 7007c6d..ffe0007 100644
--- a/web/modules/rhn/RHN/DB/ServerActions.pm
+++ b/web/modules/rhn/RHN/DB/ServerActions.pm
@@ -92,46 +92,4 @@ sub remove_set_from_group {
}
-sub subscribe_set_to_channel {
- my $class = shift;
- my $set = shift;
- my $channel_id = shift;
- my $transaction = shift;
-
- my $query = <<EOQ;
-BEGIN
- rhn_channel.bulk_subscribe_server(?, ?, ?);
-END;
-EOQ
-
- my $dbh = $transaction || RHN::DB->connect();
- my $sth = $dbh->prepare($query);
- $sth->execute($channel_id, $set->label, $set->uid);
-
- $dbh->commit unless $transaction;
-
- return $dbh;
-}
-
-sub unsubscribe_set_from_channel {
- my $class = shift;
- my $set = shift;
- my $channel_id = shift;
- my $transaction = shift;
-
- my $query = <<EOQ;
-BEGIN
- rhn_channel.bulk_unsubscribe_server(?, ?, ?);
-END;
-EOQ
-
- my $dbh = $transaction || RHN::DB->connect();
- my $sth = $dbh->prepare($query);
- $sth->execute($channel_id, $set->label, $set->uid);
-
- $dbh->commit unless $transaction;
-
- return $dbh;
-}
-
1;
diff --git a/web/modules/sniglets/Sniglets/Channel.pm b/web/modules/sniglets/Sniglets/Channel.pm
index 67bb5a2..4ca6b59 100644
--- a/web/modules/sniglets/Sniglets/Channel.pm
+++ b/web/modules/sniglets/Sniglets/Channel.pm
@@ -49,8 +49,6 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
- # sscd
- $pxt->register_callback('rhn:sscd_alter_channel_membership_cb' => \&sscd_alter_channel_membership_cb);
$pxt->register_callback('rhn:globally_subscribable_cb' => \&globally_subscribable_cb);
}
@@ -99,72 +97,6 @@ sub channel_gpg_key {
return PXT::Utils->perform_substitutions($block, \%subst);
}
-sub sscd_alter_channel_membership_cb {
- my $pxt = shift;
-
-
- PXT::Debug->log(7, "in sscd_alter_channel_membership_cb...");
-
- my @to_subscribe;
- my @to_unsubscribe;
- my $channel_set = new RHN::DB::Set 'channel_list', $pxt->user->id;
-
- my @params = $pxt->param;
-
- # warn "setting channel_list for un/subscriptions...";
- PXT::Debug->log(7, "setting channel_list for un/subscriptions...");
-
- $channel_set->empty;
- $channel_set->commit;
- foreach my $param (grep {m/(\d)+?/} @params) {
- my $value = $pxt->dirty_param($param);
-
- push @to_subscribe, $param if ($value eq 'subscribe');
- push @to_unsubscribe, $param if ($value eq 'unsubscribe');
- }
-
-
- # see if any of the requested channels are no longer allowed to be subscribed,
- # also protects against forged requests...
- if (not $pxt->user->verify_channel_subscribe(@to_subscribe)) {
- my $error_msg = <<EOM;
-You no longer have subscription access to some of the channels you selected.<br />
-Please review your selections and try again.
-EOM
- $pxt->push_message(local_alert => $error_msg);
- $pxt->redirect("/network/systems/ssm/channels/index.pxt");
- }
-
- $channel_set->add( map { [ $_, $SUBSCRIBE ] } @to_subscribe );
- $channel_set->add( map { [ $_, $UNSUBSCRIBE ] } @to_unsubscribe );
- $channel_set->commit;
-
- PXT::Debug->log(7, "channel set committed...");
- PXT::Debug->log_dump(7, \$channel_set);
-
- my @license_channels = RHN::Channel->available_channels_with_license($pxt->user->org_id);
- my %consent_required = map { $_->[0] => 1 } @license_channels;
-
- my @channels_needing_consent;
-
- foreach my $channel_to_subscribe (@to_subscribe) {
- if ($consent_required{$channel_to_subscribe}) {
- push @channels_needing_consent, $channel_to_subscribe;
- }
- }
-
- my $cid;
- if (@channels_needing_consent) {
- my $cid = pop @channels_needing_consent;
- my $params = $cid;
-
- if (@channels_needing_consent) {
- $params .= "&additional_channel=" . join("&additional_channel=", @channels_needing_consent);
- }
- $pxt->redirect("/network/systems/ssm/channels/license.pxt?cid=$cid¤t_channel=$params");
- }
-}
-
sub tri_state_channel_list {
my $pxt = shift;
diff --git a/web/modules/sniglets/Sniglets/ListView/SystemList.pm b/web/modules/sniglets/Sniglets/ListView/SystemList.pm
index 70f422a..647b058 100644
--- a/web/modules/sniglets/Sniglets/ListView/SystemList.pm
+++ b/web/modules/sniglets/Sniglets/ListView/SystemList.pm
@@ -85,11 +85,6 @@ sub _register_modes {
-datasource => RHN::DataSource::System->new,
-provider => \&visible_to_uid_provider);
- Sniglets::ListView::List->add_mode(-mode => "ssm_channel_change_conf",
- -datasource => RHN::DataSource::System->new,
- -provider => \&ssm_channel_change_conf_provider,
- -action_callback => \&ssm_channel_change_conf_cb);
-
Sniglets::ListView::List->add_mode(-mode => "systems_with_package_nvre_in_set",
-datasource => RHN::DataSource::System->new);
@@ -663,85 +658,6 @@ sub ssm_channel_change_conf_provider {
return %ret;
}
-sub ssm_channel_change_conf_cb {
- my $self = shift;
- my $pxt = shift;
-
- # think big red button
- my %action = @_;
-
- if ($action{label} eq 'ssm_change_channel_subscriptions') {
-
- my $SUBSCRIBE = 1;
- my $UNSUBSCRIBE = 2;
-
- my @to_subscribe;
- my @to_unsubscribe;
- my $channel_set = new RHN::DB::Set 'channel_list', $pxt->user->id;
-
- my $system_set = new RHN::DB::Set 'system_list', $pxt->user->id;
-
- @to_subscribe = map { $_->[0] } grep { $_->[1] eq $SUBSCRIBE } $channel_set->contents();
- @to_unsubscribe = map { $_->[0] } grep { $_->[1] eq $UNSUBSCRIBE } $channel_set->contents();
-
- # for safety's sake, filter out any rhn-satellite or rhn-proxy id that might have found their way in...
- my %rhn_satellite_ids;
- my %rhn_proxy_ids;
-
- %rhn_proxy_ids = map { $_ => 1 } RHN::Channel->rhn_proxy_channels;
- %rhn_satellite_ids = map { $_ => 1 } RHN::Channel->rhn_satellite_channels;
-
- @to_subscribe = grep {!$rhn_proxy_ids{$_} and !$rhn_satellite_ids{$_}} @to_subscribe;
- @to_unsubscribe = grep {!$rhn_proxy_ids{$_} and !$rhn_satellite_ids{$_}} @to_unsubscribe;
-
- my $transaction = RHN::DB->connect;
-
- eval {
- foreach my $channel_to_subscribe_to (@to_subscribe) {
- $transaction = RHN::ServerActions->subscribe_set_to_channel($system_set, $channel_to_subscribe_to, $transaction);
- }
-
- foreach my $channel_to_unsubscribe_from (@to_unsubscribe) {
- $transaction = RHN::ServerActions->unsubscribe_set_from_channel($system_set, $channel_to_unsubscribe_from, $transaction);
- }
-
- # w/ groups, we're probably over-snapshotting a little bit, but we're
- # likely to do far more here, due to more no-ops depending upon base-child channel
- # relationships... therefore, fix this one first.
- $transaction = RHN::Server->snapshot_set(-reason => "Channel subscription alterations",
- -set_label => 'system_list',
- -user_id => $pxt->user->id,
- -transaction => $transaction);
- };
-
- if ($@ and catchable($@)) {
- my $E = $@;
-
- $transaction->rollback;
-
- # What could go here? What exceptions might we run into? Not enough entitlements?
- if ($E->is_rhn_exception('channel_family_no_subscriptions')) {
- $pxt->push_message(local_alert => "Channel subscriptions would be exceeded, no systems subscribed. Please contact Red Hat for more channel entitlements (1-866-2-REDHAT).");
- }
- else {
- throw $E;
- }
- }
- elsif ($@) {
- $transaction->rollback();
- die $@;
- }
- else {
- $transaction->commit;
-
- $channel_set->empty;
- $channel_set->commit;
- $pxt->push_message(site_info => "Channel subscriptions changed.");
- $pxt->redirect('/network/systems/ssm/channels/index.pxt');
- }
- }
-}
-
sub row_callback {
my $self = shift;
my $row = shift;
12 years, 1 month
Branch 'flex-guest' - java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 2
java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java | 7 -
java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml | 1
java/code/src/com/redhat/rhn/domain/org/OrgFactory.java | 10 -
java/code/src/com/redhat/rhn/domain/org/test/OrgFactoryTest.java | 69 ++++++++++
java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java | 3
6 files changed, 82 insertions(+), 10 deletions(-)
New commits:
commit 285356391b0083a3a1fbee29107ac5567f0ff4b0
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 28 18:04:05 2010 -0400
fixes for org deletion and moving java code to use new org delete
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 7e187a1..9360561 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -405,7 +405,7 @@ ORDER BY UPPER(NVL(S.name, '(none)')), S.id
INFO.checkin AS LAST_CHECKIN
FROM rhnServer S, rhnServerInfo INFO
WHERE
- S.org_id = :org_id
+ S.org_id = :org_id and
S.id = INFO.server_id
</query>
</mode>
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java
index 1f1ddfb..d564af9 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.java
@@ -206,8 +206,10 @@ public class ChannelFamily extends BaseDomainHelper {
*/
public Long getMaxMembers(Org orgIn) {
PrivateChannelFamily pcf = getChannelFamilyAllocationFor(orgIn);
+ if (pcf == null) {
+ return 0L;
+ }
return pcf.getMaxMembers();
-
}
/**
@@ -217,6 +219,9 @@ public class ChannelFamily extends BaseDomainHelper {
*/
public Long getCurrentMembers(Org orgIn) {
PrivateChannelFamily pcf = getChannelFamilyAllocationFor(orgIn);
+ if (pcf == null) {
+ return 0L;
+ }
return pcf.getCurrentMembers();
}
/**
diff --git a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
index 6420dd2..26bd955 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
@@ -104,7 +104,6 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
and c.org = :org]]>
</query>
<query name="PublishedErrata.listIdsByOrg">
- <return-scalar type="long" column="id"/>
<![CDATA[
Select e.id as id
from com.redhat.rhn.domain.errata.impl.PublishedErrata as e
diff --git a/java/code/src/com/redhat/rhn/domain/org/OrgFactory.java b/java/code/src/com/redhat/rhn/domain/org/OrgFactory.java
index 8149a1e..201bb86 100644
--- a/java/code/src/com/redhat/rhn/domain/org/OrgFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/org/OrgFactory.java
@@ -23,6 +23,7 @@ import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.domain.channel.ChannelFamily;
import com.redhat.rhn.domain.role.RoleFactory;
import com.redhat.rhn.domain.server.ServerGroup;
+import com.redhat.rhn.manager.org.OrgProcedure;
import org.apache.log4j.Logger;
import org.hibernate.Session;
@@ -88,13 +89,8 @@ import java.util.Map;
*/
public static void deleteOrg(Long oid) {
// put in a sanity check here to make sure org exists
- //Org org = OrgFactory.lookupById(oid);
-
- Map in = new HashMap();
- in.put("org_id", oid);
- CallableMode m = ModeFactory.getCallableMode(
- "Org_queries", "delete_organization");
- m.execute(in, new HashMap());
+ Org org = OrgFactory.lookupById(oid);
+ OrgProcedure.getInstance().deleteOrg(org);
}
/**
diff --git a/java/code/src/com/redhat/rhn/domain/org/test/OrgFactoryTest.java b/java/code/src/com/redhat/rhn/domain/org/test/OrgFactoryTest.java
index 15b2ffc..7b6acdf 100644
--- a/java/code/src/com/redhat/rhn/domain/org/test/OrgFactoryTest.java
+++ b/java/code/src/com/redhat/rhn/domain/org/test/OrgFactoryTest.java
@@ -19,7 +19,9 @@ import com.redhat.rhn.common.db.datasource.ModeFactory;
import com.redhat.rhn.common.db.datasource.WriteMode;
import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.channel.ChannelFamily;
+import com.redhat.rhn.domain.channel.ChannelFamilyFactory;
import com.redhat.rhn.domain.channel.test.ChannelFactoryTest;
+import com.redhat.rhn.domain.errata.test.ErrataFactoryTest;
import com.redhat.rhn.domain.org.CustomDataKey;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.org.OrgEntitlementType;
@@ -30,18 +32,26 @@ import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.server.ServerConstants;
import com.redhat.rhn.domain.server.ServerGroup;
import com.redhat.rhn.domain.server.ServerGroupFactory;
+import com.redhat.rhn.domain.server.test.ServerFactoryTest;
import com.redhat.rhn.domain.server.test.ServerGroupTest;
import com.redhat.rhn.domain.token.ActivationKey;
import com.redhat.rhn.domain.token.Token;
import com.redhat.rhn.domain.token.TokenFactory;
import com.redhat.rhn.domain.token.test.ActivationKeyTest;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.user.UserFactory;
+import com.redhat.rhn.manager.entitlement.EntitlementManager;
+import com.redhat.rhn.manager.org.UpdateOrgSoftwareEntitlementsCommand;
+import com.redhat.rhn.manager.org.UpdateOrgSystemEntitlementsCommand;
+import com.redhat.rhn.testing.ConfigTestUtils;
import com.redhat.rhn.testing.RhnBaseTestCase;
import com.redhat.rhn.testing.ServerGroupTestUtils;
import com.redhat.rhn.testing.ServerTestUtils;
import com.redhat.rhn.testing.TestUtils;
import com.redhat.rhn.testing.UserTestUtils;
+import org.apache.commons.lang.RandomStringUtils;
+
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -370,4 +380,63 @@ public class OrgFactoryTest extends RhnBaseTestCase {
assertTrue(totalOrgs.size() > 0);
}
+
+ private Long getMasterManagement() {
+ return EntitlementManager.getMaxEntitlements(EntitlementManager.MANAGEMENT,
+ OrgFactory.getSatelliteOrg());
+ }
+
+ private Long getMasterRhelServer() {
+ return ChannelFamilyFactory.lookupByLabel(
+ "rhel-server", null).getChannelFamilyAllocationFor(
+ OrgFactory.getSatelliteOrg()).getMaxMembers();
+ }
+
+ public void testDeleteOrg() throws Exception {
+ Long initialMgmnt = getMasterManagement();
+ assertTrue(initialMgmnt.longValue() > 0);
+ Long initialRhel = getMasterRhelServer();
+ assertTrue(initialRhel.longValue() > 0);
+ Long changeAmt = 10L;
+
+ OrgFactoryTest test = new OrgFactoryTest();
+ Org org = test.createTestOrg();
+ Long oid = org.getId();
+ User user = UserTestUtils.createUser(RandomStringUtils.randomAlphabetic(15), oid);
+ user.addRole(RoleFactory.ORG_ADMIN);
+ UserFactory.save(user);
+
+
+
+ //clear to get the new entitlements below
+ OrgFactory.getSession().clear();
+
+ //Give it some system entitlements
+ UpdateOrgSystemEntitlementsCommand cmd1 = new UpdateOrgSystemEntitlementsCommand(
+ EntitlementManager.MANAGEMENT, org, changeAmt);
+ cmd1.store();
+ assertEquals(initialMgmnt.longValue() - getMasterManagement().longValue(),
+ changeAmt.longValue());
+
+ //Give it some system entitlements
+ UpdateOrgSoftwareEntitlementsCommand cmd2
+ = new UpdateOrgSoftwareEntitlementsCommand("rhel-server", org, changeAmt);
+ cmd2.store();
+ OrgFactory.getSession().clear();
+ assertEquals(initialRhel.longValue() - getMasterRhelServer().longValue(),
+ changeAmt.longValue());
+
+
+ ServerFactoryTest.createTestServer(org.getActiveOrgAdmins().get(0));
+ ErrataFactoryTest.createTestPublishedErrata(oid);
+ ConfigTestUtils.createConfigChannel(org);
+ org = null;
+ OrgFactory.deleteOrg(oid);
+ OrgFactory.getSession().clear();
+ assertNull(OrgFactory.lookupById(oid));
+
+ assertEquals(initialMgmnt, getMasterManagement());
+ assertEquals(initialRhel, getMasterRhelServer());
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java b/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java
index dfafc51..8f23e7e 100644
--- a/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java
+++ b/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java
@@ -81,6 +81,9 @@ public class EntitlementProcedure {
List<PrivateChannelFamily> privChannels =
ChannelFamilyFactory.listPrivateChannelFamiles(org);
for (PrivateChannelFamily priv : privChannels) {
+ if (priv.getChannelFamily().getOrg() != null) {
+ continue;
+ }
PrivateChannelFamily masterFam =
priv.getChannelFamily().getChannelFamilyAllocationFor(masterOrg);
ChannelFactory.lockPrivateChannelFamily(priv);
12 years, 1 month
Branch 'flex-guest' - 35 commits - backend/common backend/satellite_exporter backend/satellite_tools backend/spacewalk-backend.spec client/rhel rel-eng/packages schema/spacewalk
by Partha Aji
backend/common/rhnLib.py | 2
backend/satellite_exporter/handlers/non_auth_dumper.py | 362 ----------
backend/satellite_tools/disk_dumper/dumper.py | 10
backend/spacewalk-backend.spec | 5
client/rhel/rhn-client-tools/data/rh_register.glade | 56 -
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 7
client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py | 8
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 30
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 23
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 4
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 10
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/common/tables/tables.deps | 5
13 files changed, 45 insertions(+), 479 deletions(-)
New commits:
commit bbf761736265b60bb0e750461e96e309929b7ebf
Merge: 8901867... 00c6fa1...
Author: Partha Aji <paji(a)redhat.com>
Date: Fri May 28 18:04:21 2010 -0400
Merge branch 'master' into flex-guest
commit 00c6fa1d4d38d86be76ea7b4d100a34d64b84f1e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 23:08:44 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.17-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 2be729f..aad8257 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.16
+Version: 1.1.17
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri May 28 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.17-1
+- removed code relying on dead rhnDumpSnapshot* tables
+
* Thu May 27 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.16-1
- block old spacewalk from syncing sha256 channels via ISS
- improved performance of linking packages during satellite-sync
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 18feab7..1958ed2 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.16-1 backend/
+1.1.17-1 backend/
commit cd0037f54ecaf3b590afc087ba5a0fb8396373a1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 22:58:47 2010 +0200
fixed AttributeError: 'int' object has no attribute 'split'
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index 61c915f..67f49dd 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -1327,7 +1327,7 @@ class ShortPackagesDumper(CachedDumper, exportLib.ShortPackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-short-packages/%s/rhn-package-short-%s.xml" % (
hash_val, package_id)
@@ -1381,7 +1381,7 @@ class PackagesDumper(CachedDumper, exportLib.PackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-package-%s.xml" % (hash_val, package_id)
@@ -1419,7 +1419,7 @@ class SourcePackagesDumper(CachedDumper, exportLib.SourcePackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-source-package-%s.xml" % (hash_val, package_id)
@@ -1453,7 +1453,7 @@ class ErrataDumper(CachedDumper, exportLib.ErrataDumper):
CachedDumper.__init__(self, writer, statement=h, params=errata)
def _get_key(self, params):
- errata_id = params['errata_id']
+ errata_id = str(params['errata_id'])
hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
@@ -1487,7 +1487,7 @@ class ErrataDumperEx(CachedDumper, exportLib.ErrataSynopsisDumper):
CachedDumper.__init__(self, writer, statement=h, params=errata)
def _get_key(self, params):
- errata_id = params['errata_id']
+ errata_id = str(params['errata_id'])
hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
commit 6de0b98d21b3c6f7b7a47c25ef35126846624ee1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 22:51:04 2010 +0200
fixed TypeError: hash_object_id() takes exactly 3 arguments (2 given)
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 0905f9b..752cc38 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,7 +172,7 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
-def hash_object_id(self, object_id, factor):
+def hash_object_id(object_id, factor):
"""Given an object id (assumed to be <label>-<number>), returns the
last few digits for the number. For instance, (812345, 3) should
return 345"""
commit ff5c842964d193027194431cfe5bddc8e02a40ee
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:29:16 2010 +0200
list_minus() not used anywhere
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 220e2f0..e4fcd31 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -511,23 +511,6 @@ class ChannelsDumper(exportLib.ChannelsDumper):
except:
raise
-def list_minus(l1, l2, comp_func=lambda x: x):
- """
- Returns l1 minus l2, comparing each item of l1 and l2 after filtering
- them through comp_func
- """
- h = {}
- for i in l2:
- index = comp_func(i)
- h[index] = i
-
- ret = []
- for i in l1:
- index = comp_func(i)
- if not h.has_key(index):
- ret.append(i)
- return ret
-
_query_lookup_last_modified_packages = rhnSQL.Statement("""
select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
from rhnPackage
commit d5f2a6d1e943572cb7146f728ab959cbf1028d6b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:13:26 2010 +0200
removed empty _ChannelSnapshotter()
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index d339f59..220e2f0 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -505,15 +505,12 @@ class ChannelsDumper(exportLib.ChannelsDumper):
return dumper.QueryIterator(statement=h, params=self._channels)
def dump_subelement(self, data):
- c = _ChannelSnapshotter(self._writer, data)
+ c = exportLib.ChannelDumper(self._writer, data)
try:
c.dump()
except:
raise
-class _ChannelSnapshotter(exportLib.ChannelDumper):
- pass
-
def list_minus(l1, l2, comp_func=lambda x: x):
"""
Returns l1 minus l2, comparing each item of l1 and l2 after filtering
commit 0c9879e8361461b1d981f0323a02567cb77aa6aa
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:10:46 2010 +0200
_query_lookup_last_modified_errata() not used anywhere
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 8d95ca3..d339f59 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -546,21 +546,6 @@ def _lookup_last_modified_packages(package_ids):
ret.append((pid, row['last_modified']))
return ret
-_query_lookup_last_modified_errata = rhnSQL.Statement("""
- select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnErrata
- where id = :id
-""")
-def _lookup_last_modified_errata(errata_ids):
- h = rhnSQL.prepare(_query_lookup_last_modified_errata)
- ret = []
- for eid in errata_ids:
- h.execute(id=eid)
- row = h.fetchone_dict()
- assert row, "Invalid errata id %s" % eid
- ret.append((eid, row['last_modified']))
- return ret
-
_query_lookup_last_modified_ks_trees = rhnSQL.Statement("""
select TO_CHAR(kt.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
from rhnKickstartableTree kt, rhnChannel c
commit 9dd317a466a36ede6454146a1f528edf775420a5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:07:59 2010 +0200
_ChannelDumper is dead since removal of snapshot from ChannelDumper
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 3ead30f..8d95ca3 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -514,109 +514,6 @@ class ChannelsDumper(exportLib.ChannelsDumper):
class _ChannelSnapshotter(exportLib.ChannelDumper):
pass
-class _ChannelDumper(exportLib.ChannelDumper):
- def __init__(self, writer, data, snapshot, incremental=0):
- exportLib.ChannelDumper.__init__(self, writer, data)
- self.snapshot = snapshot
- assert self.snapshot is not None, \
- "Programmer error: wrong class for snapshotting"
- self.channel_id = None
- self.channel_label = None
- self.snapshot_id = None
- self.snapshot_channel_id = None
- self.incremental = incremental
- # Initialize snapshot_id and snapshot_channel_id
- self.init()
- log_debug(4, snapshot, incremental, self.snapshot_id,
- self.snapshot_channel_id)
-
- def init(self):
- self.channel_id = self._row['id']
- self.channel_label = self._row['label']
- h = rhnSQL.prepare(self._query_get_snapshot_ids)
- h.execute(snapshot=self.snapshot, channel_id=self.channel_id)
- row = h.fetchone_dict()
- self.snapshot_id = row['snapshot_id']
- self.snapshot_channel_id = row['snapshot_channel_id']
- self._all_packages = None
-
- def set_attributes(self):
- ret = exportLib.ChannelDumper.set_attributes(self)
-
- if self.incremental:
- # create all-packages
- # self._get_package_ids() will populate self._all_packages
- all_packages = [ "rhn-package-%s" % x for x in self._all_packages ]
- ret['all-packages'] = " ".join(all_packages)
- return ret
-
- def _get_package_ids(self):
- # this function has a side-effect of populating self._all_packages
- # if we are doing an incremental
- # It will return:
- # - all packages in the snapshot if we are trying to generate a
- # baseline
- # - all packages in the channel minus all packages in the snapshot if
- # we are generating an incremental
-
- snapshot_packages = self.__get_snapshot_packages()
- if not self.incremental:
- # All we need is the snapshotted packages
- # Drop last_modified
- return [ x[0] for x in snapshot_packages ]
-
- # Get a list of all packages in this channel
- self._all_packages = exportLib.ChannelDumper._get_package_ids(self)
- all_packages = _lookup_last_modified_packages(self._all_packages)
-
- # need to return self._all_packages minus snapshot_packages
- minus = list_minus(all_packages, snapshot_packages)
- return [ x[0] for x in minus ]
-
- def __get_statement_data(self, statement):
- h = rhnSQL.prepare(statement)
- h.execute(snapshot_channel_id=self.snapshot_channel_id)
- data = h.fetchall()
- data.sort()
- return data
-
- def _get_cursor_source_packages(self):
- snapshot_source_packages = self.__get_snapshot_source_packages()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return exportLib.ArrayIterator(snapshot_source_packages)
-
- h = exportLib.ChannelDumper._get_cursor_source_packages(self)
- all_source_packages = h.fetchall_dict() or []
-
- new_objs = list_minus(all_source_packages, snapshot_source_packages,
- lambda x: (x['id'], x['last_modified']))
- return exportLib.ArrayIterator(new_objs)
-
- def _get_errata_ids(self):
- snapshot_errata = self.__get_snapshot_errata()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return [ x[0] for x in snapshot_errata ]
-
- all_errata = exportLib.ChannelDumper._get_errata_ids(self)
- all_errata = _lookup_last_modified_errata(all_errata)
- minus = list_minus(all_errata, snapshot_errata)
- return [ x[0] for x in minus ]
-
- def _get_kickstartable_trees(self):
- snapshot_ks_trees = self.__get_snapshot_ks_tree()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return [ x[0] for x in snapshot_ks_trees ]
-
- all_ks_trees = exportLib.ChannelDumper._get_kickstartable_trees(self)
- all_ks_trees = _lookup_last_modified_ks_trees(self.channel_label,
- all_ks_trees)
-
- minus = list_minus(all_ks_trees, snapshot_ks_trees)
- return [ x[0] for x in minus ]
-
def list_minus(l1, l2, comp_func=lambda x: x):
"""
Returns l1 minus l2, comparing each item of l1 and l2 after filtering
commit 9638acfa075859ba660212ca0bc3c01ee435d0ed
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:05:05 2010 +0200
nobody pass snapshot or incremental to ChannelsDumper(), removing
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index c77386e..3ead30f 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -490,12 +490,10 @@ class ContainerWriter:
# based on the creation date
# XXX No caching for now
class ChannelsDumper(exportLib.ChannelsDumper):
- def __init__(self, writer, channels, snapshot=None, incremental=0):
+ def __init__(self, writer, channels)
# if snapshot is None, then all the objects from the channel are
# returned - this is useful for snapshotting
exportLib.ChannelsDumper.__init__(self, writer, channels)
- self.snapshot = snapshot
- self.incremental = incremental
def set_iterator(self):
if not self._channels:
@@ -507,11 +505,7 @@ class ChannelsDumper(exportLib.ChannelsDumper):
return dumper.QueryIterator(statement=h, params=self._channels)
def dump_subelement(self, data):
- if self.snapshot:
- c = _ChannelDumper(self._writer, data, self.snapshot,
- self.incremental)
- else:
- c = _ChannelSnapshotter(self._writer, data)
+ c = _ChannelSnapshotter(self._writer, data)
try:
c.dump()
except:
commit e737a41088953b6857d9b5bbf417ee1b9cc4c934
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:46:13 2010 +0200
__get_snapshot_ks_tree() is dead since _query_get_snapshot_ks_tree
removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 10fe2f9..c77386e 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_ks_tree(self):
- return self.__get_statement_data(self._query_get_snapshot_ks_tree)
-
def _get_cursor_source_packages(self):
snapshot_source_packages = self.__get_snapshot_source_packages()
if not self.incremental:
commit 847d5814f05dcd66cc00a88024b8230fcc258e2b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:45:30 2010 +0200
__get_snapshot_errata() is dead since _query_get_snapshot_errata removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 53309f5..10fe2f9 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_errata(self):
- return self.__get_statement_data(self._query_get_snapshot_errata)
-
def __get_snapshot_ks_tree(self):
return self.__get_statement_data(self._query_get_snapshot_ks_tree)
commit 46467eb01e248acbdb90b137af92c569fc86e7d7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:44:55 2010 +0200
__get_snapshot_source_packages() is dead since _query_get_snapshot_source_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 854c1d2..53309f5 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,12 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_source_packages(self):
- h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
- h.execute(snapshot_channel_id=self.snapshot_channel_id)
- data = h.fetchall_dict() or []
- return data
-
def __get_snapshot_errata(self):
return self.__get_statement_data(self._query_get_snapshot_errata)
commit bef2edea7d580c77313f2cbd2a49a972fb8c5b05
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:43:53 2010 +0200
__get_snapshot_packages() is dead since _query_get_snapshot_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 81f1300..854c1d2 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_packages(self):
- return self.__get_statement_data(self._query_get_snapshot_packages)
-
def __get_snapshot_source_packages(self):
h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
h.execute(snapshot_channel_id=self.snapshot_channel_id)
commit e6ac61ec5dd7b9f070d2e2ac7b69e1811725cded
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:43:08 2010 +0200
_snapshot_channel_ks_trees() is dead since _query_snapshot_channel_ks_trees removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 30d5e67..81f1300 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,13 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_ks_trees(self, channels, channel_data):
- self._do_snapshot('ks_trees', channels, channel_data,
- self._query_snapshot_channel_ks_trees,
- with_channels=1)
- return {}
-
-
def arches(self):
return self.dump_arches(rpm_arch_type_only=1)
commit a341a0b66ec37bc0ff6731c82c7b6ba8ffc71ca7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:42:31 2010 +0200
_snapshot_channel_errata() is dead since _query_snapshot_channel_errata removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 85cd8d3..30d5e67 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_errata(self, channels, channel_data):
- self._do_snapshot('errata', channels, channel_data,
- self._query_snapshot_channel_errata)
- return {}
-
def _snapshot_channel_ks_trees(self, channels, channel_data):
self._do_snapshot('ks_trees', channels, channel_data,
self._query_snapshot_channel_ks_trees,
commit 64726e217e49544ed0f2c1d360e089bf683d6353
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:41:44 2010 +0200
_snapshot_channel_package_sources() is dead since _query_snapshot_channel_source_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 26ac75d..85cd8d3 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_package_sources(self, channels, channel_data):
- self._do_snapshot('source_packages', channels, channel_data,
- self._query_snapshot_channel_source_packages)
- return {}
-
def _snapshot_channel_errata(self, channels, channel_data):
self._do_snapshot('errata', channels, channel_data,
self._query_snapshot_channel_errata)
commit 90d5cc966bfc31f496a45264cbc3cdeeb674e395
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:40:43 2010 +0200
_snapshot_channel_packages() is dead since _query_snapshot_channel_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 20fe651..26ac75d 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_packages(self, channels, channel_data):
- self._do_snapshot('packages', channels, channel_data,
- self._query_snapshot_channel_packages)
- return {}
-
def _snapshot_channel_package_sources(self, channels, channel_data):
self._do_snapshot('source_packages', channels, channel_data,
self._query_snapshot_channel_source_packages)
commit b05ecf06ab791c24ae2867e6539cc7b8fdd15130
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:38:51 2010 +0200
none of rhnDumpSnapshot* exists anymore
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index ff4f71b..20fe651 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -94,14 +94,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
', '.join(["'%s'" % x for x in channel_labels]), )
return self
- _query_purge_snapshot = rhnSQL.Statement("""
- delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
- """)
- _query_snapshot_channels = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannel (id, snapshot_id, channel_id)
- values (:id, :snapshot_id, :channel_id)
- """)
-
def _get_channel_data(self, channels):
writer = ContainerWriter()
d = ChannelsDumper(writer, channels=channels.values())
@@ -214,48 +206,21 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- _query_snapshot_channel_packages = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelPackage
- (snapshot_channel_id, package_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_packages(self, channels, channel_data):
self._do_snapshot('packages', channels, channel_data,
self._query_snapshot_channel_packages)
return {}
- _query_snapshot_channel_source_packages = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelPkgSrc
- (snapshot_channel_id, package_source_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_package_sources(self, channels, channel_data):
self._do_snapshot('source_packages', channels, channel_data,
self._query_snapshot_channel_source_packages)
return {}
- _query_snapshot_channel_errata = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelErrata
- (snapshot_channel_id, errata_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_errata(self, channels, channel_data):
self._do_snapshot('errata', channels, channel_data,
self._query_snapshot_channel_errata)
return {}
- _query_snapshot_channel_ks_trees = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelKSTree
- (snapshot_channel_id, ks_tree_id, last_modified)
- select :snapshot_channel_id, id, TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS')
- from rhnKickstartableTree
- where label = :obj_id
- and org_id is null
- and channel_id = :channel_id
- """)
def _snapshot_channel_ks_trees(self, channels, channel_data):
self._do_snapshot('ks_trees', channels, channel_data,
self._query_snapshot_channel_ks_trees,
@@ -643,52 +608,18 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- _query_get_snapshot_packages = rhnSQL.Statement("""
- select dscp.package_id,
- TO_CHAR(dscp.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelPackage dscp
- where dscp.snapshot_channel_id = :snapshot_channel_id
- """)
def __get_snapshot_packages(self):
return self.__get_statement_data(self._query_get_snapshot_packages)
- _query_get_snapshot_source_packages = rhnSQL.Statement("""
- select dscps.package_source_id id,
- sr.name source_rpm,
- TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified
- from rhnSourceRPM sr,
- rhnPackageSource ps,
- rhnDumpSnapshotChannelPkgSrc dscps
- where dscps.snapshot_channel_id = :snapshot_channel_id
- and dscps.package_source_id = ps.id
- and ps.source_rpm_id = sr.id
- """)
def __get_snapshot_source_packages(self):
h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
h.execute(snapshot_channel_id=self.snapshot_channel_id)
data = h.fetchall_dict() or []
return data
- _query_get_snapshot_errata = rhnSQL.Statement("""
- select dsce.errata_id,
- TO_CHAR(dsce.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelErrata dsce
- where dsce.snapshot_channel_id = :snapshot_channel_id
- """)
def __get_snapshot_errata(self):
return self.__get_statement_data(self._query_get_snapshot_errata)
- _query_get_snapshot_ks_tree = rhnSQL.Statement("""
- select kt.label,
- TO_CHAR(dsckt.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelKSTree dsckt,
- rhnDumpSnapshotChannel dsc,
- rhnKickstartableTree kt
- where dsckt.snapshot_channel_id = :snapshot_channel_id
- and dsckt.ks_tree_id = kt.id
- and dsc.id = :snapshot_channel_id
- and dsc.channel_id = kt.channel_id
- """)
def __get_snapshot_ks_tree(self):
return self.__get_statement_data(self._query_get_snapshot_ks_tree)
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 1b6df11..1515473 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -81,10 +81,6 @@ rhnCryptoKeyKickstart :: rhnCryptoKey rhnKSData
rhnDevice :: rhnServer
rhnDistChannelMap :: rhnChannel rhnChannelArch
rhnDownloads :: rhnChannelFamily rhnFile rhnDownloadType
-rhnDumpSnapshotChannelErrata :: rhnDumpSnapshotChannel rhnErrata
-rhnDumpSnapshotChannelPackage :: rhnDumpSnapshotChannel rhnPackage
-rhnDumpSnapshotChannelPkgSrc :: rhnDumpSnapshotChannel rhnPackageSource
-rhnDumpSnapshotChannelKSTree :: rhnDumpSnapshotChannel rhnKickstartableTree
rhnEmailAddress :: rhnEmailAddressState web_contact
rhnEntitlementQueue :: web_customer
rhnErrata :: rhnChecksum web_customer rhnErrataSeverity
commit f9adeea76a3eb26cb419532438765af0ba480437
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:15:09 2010 +0200
_validate_channels_snapshot() is dead since _query_validate_channel_snapshot removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 9159617..ff4f71b 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -484,24 +484,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
_get_package_id = staticmethod(_get_package_id)
- def _validate_channels_snapshot(self, snapshot, channels):
- h = rhnSQL.prepare(self._query_validate_channel_snapshot)
- missing_channels = []
- snapshot_id = None
- for c in channels.values():
- channel_id = c['channel_id']
- h.execute(channel_id=channel_id, snapshot=snapshot)
- row = h.fetchone_dict()
- if row:
- snapshot_id = row['snapshot_id']
- else:
- missing_channels.append(c)
- if missing_channels:
- missing_labels = [ x['label'] for x in missing_channels ]
- raise rhnFault(3014, "snapshot: %s; channels: %s" %
- (snapshot, ' '.join(missing_labels)))
- return snapshot_id
-
def _respond_xmlrpc(self, data):
# Marshal
s = xmlrpclib.dumps((data, ))
commit c9322412ab2e8da00ad68cf25def3da17aba3527
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:13:56 2010 +0200
snapshot_channels() is dead since _snapshot_channels() removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 4db0274..9159617 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -62,7 +62,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
'get_source_rpm',
'kickstartable_trees',
'get_ks_file',
- 'snapshot_channels',
]
self.system_id = None
@@ -95,20 +94,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
', '.join(["'%s'" % x for x in channel_labels]), )
return self
- def snapshot_channels(self, snapshot, channel_labels=[], flags={}):
- """ Snapshotting channels - *does* writes in the DB """
- log_debug(2, snapshot, channel_labels)
- self.set_channel_family_query(channel_labels=channel_labels)
- channels = self._validate_channels(channel_labels=channel_labels)
- try:
- ret = self._snapshot_channels(snapshot, channels, flags)
- except:
- rhnSQL.rollback()
- raise
- else:
- rhnSQL.commit()
- return self._respond_xmlrpc(ret)
-
_query_purge_snapshot = rhnSQL.Statement("""
delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
""")
commit 3b54ca3716d14e0ecfbbfca5f3868ab5c1d1e803
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:07:49 2010 +0200
_snapshot_channels() is dead since query_lookup_snapshot and _query_create_snapshot removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 27993be..4db0274 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -116,61 +116,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
insert into rhnDumpSnapshotChannel (id, snapshot_id, channel_id)
values (:id, :snapshot_id, :channel_id)
""")
- def _snapshot_channels(self, snapshot, channels, flags):
- log_debug(3, snapshot, channels)
- retval = {}
- # Does the snapshot exist?
- h = rhnSQL.prepare(self._query_lookup_snapshot)
- h.execute(snapshot=snapshot)
- row = h.fetchone_dict()
- if row:
- # Did they ask to force this snapshot?
- if not flags.has_key('force'):
- # XXX
- raise Exception("did not ask for force")
- snapshot_id = row['id']
- # Remove old stuff
- h = rhnSQL.prepare(self._query_purge_snapshot)
- h.execute(snapshot_id=snapshot_id)
- else:
- snapshot_id = rhnSQL.Sequence('rhn_dump_snapshot_id_seq').next()
- h = rhnSQL.prepare(self._query_create_snapshot)
- h.execute(snapshot_id=snapshot_id, snapshot=snapshot)
-
- if not channels:
- # Nothing more to do
- # We don't exit from the very beginning because we may want to
- # clear a specific tag
- return retval
-
- channel_ids = []
- snapshot_ids = []
- snapshot_channel_ids = []
-
- seq = rhnSQL.Sequence('rhn_dump_snap_chan_id_seq')
- for channel_hash in channels.values():
- channel_id = channel_hash['channel_id']
- snapshot_channel_id = channel_hash['snapshot_channel_id'] = \
- seq.next()
-
- channel_ids.append(channel_id)
- snapshot_ids.append(snapshot_id)
- snapshot_channel_ids.append(snapshot_channel_id)
-
- h = rhnSQL.prepare(self._query_snapshot_channels)
- h.executemany(id=snapshot_channel_ids, snapshot_id=snapshot_ids,
- channel_id=channel_ids)
-
- channel_data = self._get_channel_data(channels)
- channel_data = self._lookup_last_modified(channel_data)
-
- retval.update(self._snapshot_channel_packages(channels, channel_data))
- retval.update(self._snapshot_channel_package_sources(channels,
- channel_data))
- retval.update(self._snapshot_channel_errata(channels, channel_data))
- retval.update(self._snapshot_channel_ks_trees(channels, channel_data))
-
- return retval
def _get_channel_data(self, channels):
writer = ContainerWriter()
commit e0f395fc153ddb353342e039859fb7f9f4ff8445
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:02:47 2010 +0200
there is no rhnDumpSnapshot table - removing dead SQL code
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index e3b7319..27993be 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -109,12 +109,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
rhnSQL.commit()
return self._respond_xmlrpc(ret)
- _query_lookup_snapshot = rhnSQL.Statement("""
- select id from rhnDumpSnapshot where snapshot = :snapshot
- """)
- _query_create_snapshot = rhnSQL.Statement("""
- insert into rhnDumpSnapshot (id, snapshot) values (:snapshot_id, :snapshot)
- """)
_query_purge_snapshot = rhnSQL.Statement("""
delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
""")
@@ -560,13 +554,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
_get_package_id = staticmethod(_get_package_id)
- _query_validate_channel_snapshot = rhnSQL.Statement("""
- select dsc.snapshot_id
- from rhnDumpSnapshot ds, rhnDumpSnapshotChannel dsc
- where dsc.channel_id = :channel_id
- and dsc.snapshot_id = ds.id
- and ds.snapshot = :snapshot
- """)
def _validate_channels_snapshot(self, snapshot, channels):
h = rhnSQL.prepare(self._query_validate_channel_snapshot)
missing_channels = []
@@ -694,13 +681,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
log_debug(4, snapshot, incremental, self.snapshot_id,
self.snapshot_channel_id)
- _query_get_snapshot_ids = rhnSQL.Statement("""
- select ds.id snapshot_id, dsc.id snapshot_channel_id
- from rhnDumpSnapshot ds, rhnDumpSnapshotChannel dsc
- where dsc.channel_id = :channel_id
- and dsc.snapshot_id = ds.id
- and ds.snapshot = :snapshot
- """)
def init(self):
self.channel_id = self._row['id']
self.channel_label = self._row['label']
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 5300439..1b6df11 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -81,7 +81,6 @@ rhnCryptoKeyKickstart :: rhnCryptoKey rhnKSData
rhnDevice :: rhnServer
rhnDistChannelMap :: rhnChannel rhnChannelArch
rhnDownloads :: rhnChannelFamily rhnFile rhnDownloadType
-rhnDumpSnapshotChannel :: rhnDumpSnapshot rhnChannel
rhnDumpSnapshotChannelErrata :: rhnDumpSnapshotChannel rhnErrata
rhnDumpSnapshotChannelPackage :: rhnDumpSnapshotChannel rhnPackage
rhnDumpSnapshotChannelPkgSrc :: rhnDumpSnapshotChannel rhnPackageSource
commit 5e7f86b0226527cce64a6e749249d5d5b512b4aa
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:48:58 2010 +0200
Method resetServerList not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
index 8ca327a..9aa55b6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py
@@ -103,10 +103,6 @@ class ServerList:
return None
return self.server()
- def resetServerList(self, serverlist):
- self.serverList = serverlist
- self.index = 0
-
def resetServerIndex(self):
self.index = 0
commit 933762fe6e3269589102d5cbb9f3beb10c95f08d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:48:34 2010 +0200
When startRhnCheck was replaced by spawnRhnCheckForUI, it became unused, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index df6193a..fdaa0eb 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -58,12 +58,6 @@ def startRhnsd():
if rc:
os.system("/sbin/service rhnsd start > /dev/null")
-def startRhnCheck():
- if os.access("/usr/sbin/rhn_check", os.R_OK|os.X_OK):
- os.system("/usr/sbin/rhn_check")
- else:
- print _("Warning: unable to run rhn_check")
-
def getOemInfo():
configFile = cfg["oemInfoFile"] or "/etc/sysconfig/rhn/oeminfo"
commit 681157b4a38719f00cc76e791dff5d54af5399db
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:42:29 2010 +0200
Method getFailedSystemSlots not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index 8152bf2..df6193a 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -269,9 +269,6 @@ class RegistrationResult:
def getSystemSlotDescriptions(self):
return map(self._getSlotDescription, self._systemSlots)
- def getFailedSystemSlots(self):
- return self._failedSystemSlots
-
def getFailedSystemSlotDescriptions(self):
return map(self._getFailedSlotDescription, self._failedSystemSlots)
commit bbed67d7b8507d793b261d0babbbb80c11d065f0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:41:37 2010 +0200
get_device_property not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py b/client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py
index 703a24a..73a606c 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py
@@ -324,14 +324,6 @@ def get_device_pcitype(node):
return pcitype
-def get_device_property(device, property_name):
- """ Return a hal device property, or None if it does not exist. """
- if device.PropertyExists(property_name):
- # Convert from unicode to ascii in case the server can't handle it.
- return str(device.GetProperty(property_name))
- else:
- return None
-
def get_hal_computer():
bus = dbus.SystemBus()
computer_obj = bus.get_object("org.freedesktop.Hal",
commit 1eace720d6856d318f4905d2dc69449e7ed1c1c2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:40:29 2010 +0200
termsAndConditions not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index 0b36d95..8152bf2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -229,11 +229,6 @@ def getCaps():
# figure out if were missing any needed caps
s.capabilities.validate()
-def termsAndConditions():
- s = rhnserver.RhnServer()
-
- return s.registration.terms_and_conditionsi()
-
def reserveUser(username, password):
s = rhnserver.RhnServer()
return s.registration.reserve_user(username, password)
commit 30e7446f8be219655bdc56882dcd611ea796af3b
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:40:00 2010 +0200
sat_supports_virt_guest_registration not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index 8f1d5d9..0b36d95 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -450,18 +450,6 @@ def updateContactInfo(username, password, productInfo):
def server_supports_eus():
return cfg["supportsEUS"]
-def sat_supports_virt_guest_registration():
- s = rhnserver.RhnServer()
-
- if s.capabilities.has_key('registration.remaining_subscriptions'):
- if int(s.capabilities['registration.remaining_subscriptions']['version']) > 1:
- return True
- else:
- return False
- else:
- return False
-
-
def sendHardware(systemId, hardwareList):
s = rhnserver.RhnServer()
s.registration.add_hw_profile(systemId, hardwareList)
commit fbd1a534d4d3309c1eb39f99296343a6d7c18486
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:38:37 2010 +0200
finishMessage not used in our code, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index eb9df6d..8f1d5d9 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -224,10 +224,6 @@ def welcomeText():
return s.registration.welcome_message()
-def finishMessage(systemId):
- s = rhnserver.RhnServer()
- return s.registration.finish_message(systemId)
-
def getCaps():
s = rhnserver.RhnServer()
# figure out if were missing any needed caps
commit 20b01cb7a0aa6322f410e5b9ed123d65dcc0e6cb
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:37:30 2010 +0200
When autoActivateNumbersOnce was removed, autoActivatedHardwareInfo was made unused, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index faa0ff9..81cc0a6 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -109,17 +109,6 @@ class ReviewLog:
def getTextBuffer(self):
return self._text
- def autoActivatedHardwareInfo(self, activationResult):
- self.addBoldText(_("Automatic Subscription Activation"))
- text = rhnreg_constants.SUB_NUM % activationResult.getRegistrationNumber()
- text = text + ' ' + rhnreg_constants.SUB_NUM_RESULT
- self.addText(text)
- for channel, quantity in activationResult.getChannelsActivated().items():
- self.addBulletedText("%s (%s)" % (channel, quantity))
- for service, quantity in activationResult.getSystemSlotsActivated().items():
- self.addBulletedText("%s (%s)" % (service, quantity))
- self.addText('') # adds newline
-
def usedUniversalActivationKey(self, keyName):
self.addBoldText(_("Notice"))
keys = ', '.join(keyName)
commit b913aab6ee9c1d4055906b247ec338f9b5e89103
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:36:16 2010 +0200
When ActivateSubscriptionPage was removed, activatedRegistrationNumber was made unused, removing.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 3722ffb..faa0ff9 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -120,18 +120,6 @@ class ReviewLog:
self.addBulletedText("%s (%s)" % (service, quantity))
self.addText('') # adds newline
- def activatedRegistrationNumber(self, registrationNumber,
- activationResult):
- self.addBoldText(_("Subscription Activation"))
- text = rhnreg_constants.SUB_NUM % registrationNumber
- text = text + ' ' + rhnreg_constants.SUB_NUM_RESULT
- self.addText(text)
- for channel, quantity in activationResult.getChannelsActivated().items():
- self.addBulletedText("%s (%s)" % (channel, quantity))
- for service, quantity in activationResult.getSystemSlotsActivated().items():
- self.addBulletedText("%s (%s)" % (service, quantity))
- self.addText('') # adds newline
-
def usedUniversalActivationKey(self, keyName):
self.addBoldText(_("Notice"))
keys = ', '.join(keyName)
commit 66a66f5122bfb5f9780ecff24b611af6c029f3ef
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 16:06:57 2010 +0200
597263 - give the focus to the ButtonBar (and thus to the Yes button), to behave as RHEL 5 did.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index fa505e6..618cf52 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -110,6 +110,11 @@ class AlreadyRegisteredWindow:
oldsystemId = systemIdXml[0][0]['system_id']
toplevel = snack.GridForm(self.screen, _("System software updates already set up"), 1, 2)
+ self.bb = snack.ButtonBar(self.screen,
+ [(YES_CONT, "next"),
+ (NO_CANCEL, "exit")])
+ toplevel.add(self.bb, 0, 1, growx = 1)
+
tb = snack.Textbox(size[0]-30, size[1]-20,
SYSTEM_ALREADY_REGISTERED + "\n\n"
+ _("Red Hat Network Location:") + " " + self.tui.serverURL + "\n"
@@ -119,11 +124,6 @@ class AlreadyRegisteredWindow:
1, 1)
toplevel.add(tb, 0, 0, padding = (0, 0, 0, 1))
- self.bb = snack.ButtonBar(self.screen,
- [(YES_CONT, "next"),
- (NO_CANCEL, "exit")])
- toplevel.add(self.bb, 0, 1, growx = 1)
-
self.g = toplevel
def saveResults(self):
commit 160626b10f2ced44b9f468b8ddb865736fca60a0
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri May 28 12:05:40 2010 +0200
596101 - skip the chooseChannelPage when going Back as well, if it should not be shown.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/gui.py b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
index 93df983..eb38c9c 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -58,6 +58,7 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
"onChooseChannelPagePrepare" : self.onChooseChannelPagePrepare,
"onCreateProfilePagePrepare" : self.onCreateProfilePagePrepare,
"onCreateProfilePageNext" : self.onCreateProfilePageNext,
+ "onCreateProfilePageBack" : self.onCreateProfilePageBack,
"onReviewSubscriptionPagePrepare" : self.onReviewSubscriptionPagePrepare,
"onReviewSubscriptionPageNext" : self.onReviewSubscriptionPageNext,
"onProvideCertificatePageBack" : self.onProvideCertificatePageBack,
@@ -259,6 +260,12 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
if ret:
return ret
+ def onCreateProfilePageBack(self, page, dummy):
+ if rhnregGui.ChooseChannelPage.chooseChannelShouldBeShown(self):
+ self.druid.set_page(self.chooseChannelPage)
+ else:
+ self.druid.set_page(self.chooseServerPage)
+ return True
def onReviewSubscriptionPagePrepare(self, page, dummy):
self.reviewSubscriptionPagePrepare()
commit 91d76707031e33e172d3fa993c5780c11a5b3bf6
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Fri May 28 11:41:19 2010 +0200
596102 - fit hw profile into a 2x6 table
This is to ensure the hardware profile gui dialog would fit into
screen with lower resolution (800x600).
diff --git a/client/rhel/rhn-client-tools/data/rh_register.glade b/client/rhel/rhn-client-tools/data/rh_register.glade
index eec1b72..b1a7785 100644
--- a/client/rhel/rhn-client-tools/data/rh_register.glade
+++ b/client/rhel/rhn-client-tools/data/rh_register.glade
@@ -830,8 +830,8 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<widget class="GtkTable" id="table8">
<property name="border_width">5</property>
<property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">4</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
@@ -855,10 +855,6 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -883,8 +879,6 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
@@ -911,8 +905,6 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
@@ -997,8 +989,6 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1023,10 +1013,8 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1051,10 +1039,8 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1079,10 +1065,8 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1107,10 +1091,10 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1135,10 +1119,10 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
@@ -1163,10 +1147,10 @@ https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small></property>
<property name="angle">0</property>
</widget>
<packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
commit c49b9075ae707c51ebfcb6b78eed61552c1efc70
Author: Partha Aji <paji(a)redhat.com>
Date: Thu May 27 19:29:40 2010 -0400
added swp files and files ending with ~ to ignore
diff --git a/scripts/link-tree.py b/scripts/link-tree.py
index 818fa10..66b8a21 100755
--- a/scripts/link-tree.py
+++ b/scripts/link-tree.py
@@ -21,7 +21,7 @@ def need_to_backup(src_dir, dest_dir):
return False
-def ignorable(f, ignorables = ["*.pyc", "*.pyo", "*.pyd", "Makefile*"]):
+def ignorable(f, ignorables = ["*.*~", "*.swp", "*.pyc", "*.pyo", "*.pyd", "Makefile*"]):
for i in ignorables:
if fnmatch.fnmatch(f, i): return True
return False
12 years, 1 month
Changes to 'refs/tags/spacewalk-backend-1.1.17-1'
by Michael Mraka
Tag 'spacewalk-backend-1.1.17-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-05-28 21:08 +0000
Tagging package [spacewalk-backend] version [1.1.17-1] in directory [backend/].
Changes since spacewalk-backend-1.1.16-1:
Jan Pazdziora (11):
596101 - skip the chooseChannelPage when going Back as well, if it should not be shown.
597263 - give the focus to the ButtonBar (and thus to the Yes button), to behave as RHEL 5 did.
When ActivateSubscriptionPage was removed, activatedRegistrationNumber was made unused, removing.
When autoActivateNumbersOnce was removed, autoActivatedHardwareInfo was made unused, removing.
finishMessage not used in our code, removing.
sat_supports_virt_guest_registration not used in our code, removing.
termsAndConditions not used in our code, removing.
get_device_property not used in our code, removing.
Method getFailedSystemSlots not used in our code, removing.
When startRhnCheck was replaced by spawnRhnCheckForUI, it became unused, removing.
Method resetServerList not used in our code, removing.
Michael Mraka (21):
there is no rhnDumpSnapshot table - removing dead SQL code
_snapshot_channels() is dead since query_lookup_snapshot and _query_create_snapshot removal
snapshot_channels() is dead since _snapshot_channels() removal
_validate_channels_snapshot() is dead since _query_validate_channel_snapshot removal
none of rhnDumpSnapshot* exists anymore
_snapshot_channel_packages() is dead since _query_snapshot_channel_packages removal
_snapshot_channel_package_sources() is dead since _query_snapshot_channel_source_packages removal
_snapshot_channel_errata() is dead since _query_snapshot_channel_errata removal
_snapshot_channel_ks_trees() is dead since _query_snapshot_channel_ks_trees removal
__get_snapshot_packages() is dead since _query_get_snapshot_packages removal
__get_snapshot_source_packages() is dead since _query_get_snapshot_source_packages removal
__get_snapshot_errata() is dead since _query_get_snapshot_errata removal
__get_snapshot_ks_tree() is dead since _query_get_snapshot_ks_tree
nobody pass snapshot or incremental to ChannelsDumper(), removing
_ChannelDumper is dead since removal of snapshot from ChannelDumper
_query_lookup_last_modified_errata() not used anywhere
removed empty _ChannelSnapshotter()
list_minus() not used anywhere
fixed TypeError: hash_object_id() takes exactly 3 arguments (2 given)
fixed AttributeError: 'int' object has no attribute 'split'
Automatic commit of package [spacewalk-backend] release [1.1.17-1].
Milan Zazrivec (1):
596102 - fit hw profile into a 2x6 table
Partha Aji (1):
added swp files and files ending with ~ to ignore
---
backend/common/rhnLib.py | 2
backend/satellite_exporter/handlers/non_auth_dumper.py | 362 ----------
backend/satellite_tools/disk_dumper/dumper.py | 10
backend/spacewalk-backend.spec | 5
client/rhel/rhn-client-tools/data/rh_register.glade | 56 -
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 7
client/rhel/rhn-client-tools/src/up2date_client/hardware_hal.py | 8
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 30
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 23
client/rhel/rhn-client-tools/src/up2date_client/rpcServer.py | 4
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 10
rel-eng/packages/spacewalk-backend | 2
schema/spacewalk/common/tables/tables.deps | 5
scripts/link-tree.py | 2
14 files changed, 46 insertions(+), 480 deletions(-)
---
12 years, 1 month
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 00c6fa1d4d38d86be76ea7b4d100a34d64b84f1e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 23:08:44 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.17-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 2be729f..aad8257 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.16
+Version: 1.1.17
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri May 28 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.17-1
+- removed code relying on dead rhnDumpSnapshot* tables
+
* Thu May 27 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.16-1
- block old spacewalk from syncing sha256 channels via ISS
- improved performance of linking packages during satellite-sync
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 18feab7..1958ed2 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.16-1 backend/
+1.1.17-1 backend/
12 years, 1 month
20 commits - backend/common backend/satellite_exporter backend/satellite_tools schema/spacewalk
by Michael Mraka
backend/common/rhnLib.py | 2
backend/satellite_exporter/handlers/non_auth_dumper.py | 362 -----------------
backend/satellite_tools/disk_dumper/dumper.py | 10
schema/spacewalk/common/tables/tables.deps | 5
4 files changed, 8 insertions(+), 371 deletions(-)
New commits:
commit cd0037f54ecaf3b590afc087ba5a0fb8396373a1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 22:58:47 2010 +0200
fixed AttributeError: 'int' object has no attribute 'split'
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index 61c915f..67f49dd 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -1327,7 +1327,7 @@ class ShortPackagesDumper(CachedDumper, exportLib.ShortPackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-short-packages/%s/rhn-package-short-%s.xml" % (
hash_val, package_id)
@@ -1381,7 +1381,7 @@ class PackagesDumper(CachedDumper, exportLib.PackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-package-%s.xml" % (hash_val, package_id)
@@ -1419,7 +1419,7 @@ class SourcePackagesDumper(CachedDumper, exportLib.SourcePackagesDumper):
CachedDumper.__init__(self, writer, statement=h, params=packages)
def _get_key(self, params):
- package_id = params['package_id']
+ package_id = str(params['package_id'])
hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-source-package-%s.xml" % (hash_val, package_id)
@@ -1453,7 +1453,7 @@ class ErrataDumper(CachedDumper, exportLib.ErrataDumper):
CachedDumper.__init__(self, writer, statement=h, params=errata)
def _get_key(self, params):
- errata_id = params['errata_id']
+ errata_id = str(params['errata_id'])
hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
@@ -1487,7 +1487,7 @@ class ErrataDumperEx(CachedDumper, exportLib.ErrataSynopsisDumper):
CachedDumper.__init__(self, writer, statement=h, params=errata)
def _get_key(self, params):
- errata_id = params['errata_id']
+ errata_id = str(params['errata_id'])
hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
commit 6de0b98d21b3c6f7b7a47c25ef35126846624ee1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 22:51:04 2010 +0200
fixed TypeError: hash_object_id() takes exactly 3 arguments (2 given)
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 0905f9b..752cc38 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,7 +172,7 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
-def hash_object_id(self, object_id, factor):
+def hash_object_id(object_id, factor):
"""Given an object id (assumed to be <label>-<number>), returns the
last few digits for the number. For instance, (812345, 3) should
return 345"""
commit ff5c842964d193027194431cfe5bddc8e02a40ee
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:29:16 2010 +0200
list_minus() not used anywhere
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 220e2f0..e4fcd31 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -511,23 +511,6 @@ class ChannelsDumper(exportLib.ChannelsDumper):
except:
raise
-def list_minus(l1, l2, comp_func=lambda x: x):
- """
- Returns l1 minus l2, comparing each item of l1 and l2 after filtering
- them through comp_func
- """
- h = {}
- for i in l2:
- index = comp_func(i)
- h[index] = i
-
- ret = []
- for i in l1:
- index = comp_func(i)
- if not h.has_key(index):
- ret.append(i)
- return ret
-
_query_lookup_last_modified_packages = rhnSQL.Statement("""
select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
from rhnPackage
commit d5f2a6d1e943572cb7146f728ab959cbf1028d6b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:13:26 2010 +0200
removed empty _ChannelSnapshotter()
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index d339f59..220e2f0 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -505,15 +505,12 @@ class ChannelsDumper(exportLib.ChannelsDumper):
return dumper.QueryIterator(statement=h, params=self._channels)
def dump_subelement(self, data):
- c = _ChannelSnapshotter(self._writer, data)
+ c = exportLib.ChannelDumper(self._writer, data)
try:
c.dump()
except:
raise
-class _ChannelSnapshotter(exportLib.ChannelDumper):
- pass
-
def list_minus(l1, l2, comp_func=lambda x: x):
"""
Returns l1 minus l2, comparing each item of l1 and l2 after filtering
commit 0c9879e8361461b1d981f0323a02567cb77aa6aa
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:10:46 2010 +0200
_query_lookup_last_modified_errata() not used anywhere
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 8d95ca3..d339f59 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -546,21 +546,6 @@ def _lookup_last_modified_packages(package_ids):
ret.append((pid, row['last_modified']))
return ret
-_query_lookup_last_modified_errata = rhnSQL.Statement("""
- select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnErrata
- where id = :id
-""")
-def _lookup_last_modified_errata(errata_ids):
- h = rhnSQL.prepare(_query_lookup_last_modified_errata)
- ret = []
- for eid in errata_ids:
- h.execute(id=eid)
- row = h.fetchone_dict()
- assert row, "Invalid errata id %s" % eid
- ret.append((eid, row['last_modified']))
- return ret
-
_query_lookup_last_modified_ks_trees = rhnSQL.Statement("""
select TO_CHAR(kt.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
from rhnKickstartableTree kt, rhnChannel c
commit 9dd317a466a36ede6454146a1f528edf775420a5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:07:59 2010 +0200
_ChannelDumper is dead since removal of snapshot from ChannelDumper
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 3ead30f..8d95ca3 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -514,109 +514,6 @@ class ChannelsDumper(exportLib.ChannelsDumper):
class _ChannelSnapshotter(exportLib.ChannelDumper):
pass
-class _ChannelDumper(exportLib.ChannelDumper):
- def __init__(self, writer, data, snapshot, incremental=0):
- exportLib.ChannelDumper.__init__(self, writer, data)
- self.snapshot = snapshot
- assert self.snapshot is not None, \
- "Programmer error: wrong class for snapshotting"
- self.channel_id = None
- self.channel_label = None
- self.snapshot_id = None
- self.snapshot_channel_id = None
- self.incremental = incremental
- # Initialize snapshot_id and snapshot_channel_id
- self.init()
- log_debug(4, snapshot, incremental, self.snapshot_id,
- self.snapshot_channel_id)
-
- def init(self):
- self.channel_id = self._row['id']
- self.channel_label = self._row['label']
- h = rhnSQL.prepare(self._query_get_snapshot_ids)
- h.execute(snapshot=self.snapshot, channel_id=self.channel_id)
- row = h.fetchone_dict()
- self.snapshot_id = row['snapshot_id']
- self.snapshot_channel_id = row['snapshot_channel_id']
- self._all_packages = None
-
- def set_attributes(self):
- ret = exportLib.ChannelDumper.set_attributes(self)
-
- if self.incremental:
- # create all-packages
- # self._get_package_ids() will populate self._all_packages
- all_packages = [ "rhn-package-%s" % x for x in self._all_packages ]
- ret['all-packages'] = " ".join(all_packages)
- return ret
-
- def _get_package_ids(self):
- # this function has a side-effect of populating self._all_packages
- # if we are doing an incremental
- # It will return:
- # - all packages in the snapshot if we are trying to generate a
- # baseline
- # - all packages in the channel minus all packages in the snapshot if
- # we are generating an incremental
-
- snapshot_packages = self.__get_snapshot_packages()
- if not self.incremental:
- # All we need is the snapshotted packages
- # Drop last_modified
- return [ x[0] for x in snapshot_packages ]
-
- # Get a list of all packages in this channel
- self._all_packages = exportLib.ChannelDumper._get_package_ids(self)
- all_packages = _lookup_last_modified_packages(self._all_packages)
-
- # need to return self._all_packages minus snapshot_packages
- minus = list_minus(all_packages, snapshot_packages)
- return [ x[0] for x in minus ]
-
- def __get_statement_data(self, statement):
- h = rhnSQL.prepare(statement)
- h.execute(snapshot_channel_id=self.snapshot_channel_id)
- data = h.fetchall()
- data.sort()
- return data
-
- def _get_cursor_source_packages(self):
- snapshot_source_packages = self.__get_snapshot_source_packages()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return exportLib.ArrayIterator(snapshot_source_packages)
-
- h = exportLib.ChannelDumper._get_cursor_source_packages(self)
- all_source_packages = h.fetchall_dict() or []
-
- new_objs = list_minus(all_source_packages, snapshot_source_packages,
- lambda x: (x['id'], x['last_modified']))
- return exportLib.ArrayIterator(new_objs)
-
- def _get_errata_ids(self):
- snapshot_errata = self.__get_snapshot_errata()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return [ x[0] for x in snapshot_errata ]
-
- all_errata = exportLib.ChannelDumper._get_errata_ids(self)
- all_errata = _lookup_last_modified_errata(all_errata)
- minus = list_minus(all_errata, snapshot_errata)
- return [ x[0] for x in minus ]
-
- def _get_kickstartable_trees(self):
- snapshot_ks_trees = self.__get_snapshot_ks_tree()
- if not self.incremental:
- # If a baseline, return objects from snapshot
- return [ x[0] for x in snapshot_ks_trees ]
-
- all_ks_trees = exportLib.ChannelDumper._get_kickstartable_trees(self)
- all_ks_trees = _lookup_last_modified_ks_trees(self.channel_label,
- all_ks_trees)
-
- minus = list_minus(all_ks_trees, snapshot_ks_trees)
- return [ x[0] for x in minus ]
-
def list_minus(l1, l2, comp_func=lambda x: x):
"""
Returns l1 minus l2, comparing each item of l1 and l2 after filtering
commit 9638acfa075859ba660212ca0bc3c01ee435d0ed
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 16:05:05 2010 +0200
nobody pass snapshot or incremental to ChannelsDumper(), removing
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index c77386e..3ead30f 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -490,12 +490,10 @@ class ContainerWriter:
# based on the creation date
# XXX No caching for now
class ChannelsDumper(exportLib.ChannelsDumper):
- def __init__(self, writer, channels, snapshot=None, incremental=0):
+ def __init__(self, writer, channels)
# if snapshot is None, then all the objects from the channel are
# returned - this is useful for snapshotting
exportLib.ChannelsDumper.__init__(self, writer, channels)
- self.snapshot = snapshot
- self.incremental = incremental
def set_iterator(self):
if not self._channels:
@@ -507,11 +505,7 @@ class ChannelsDumper(exportLib.ChannelsDumper):
return dumper.QueryIterator(statement=h, params=self._channels)
def dump_subelement(self, data):
- if self.snapshot:
- c = _ChannelDumper(self._writer, data, self.snapshot,
- self.incremental)
- else:
- c = _ChannelSnapshotter(self._writer, data)
+ c = _ChannelSnapshotter(self._writer, data)
try:
c.dump()
except:
commit e737a41088953b6857d9b5bbf417ee1b9cc4c934
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:46:13 2010 +0200
__get_snapshot_ks_tree() is dead since _query_get_snapshot_ks_tree
removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 10fe2f9..c77386e 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_ks_tree(self):
- return self.__get_statement_data(self._query_get_snapshot_ks_tree)
-
def _get_cursor_source_packages(self):
snapshot_source_packages = self.__get_snapshot_source_packages()
if not self.incremental:
commit 847d5814f05dcd66cc00a88024b8230fcc258e2b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:45:30 2010 +0200
__get_snapshot_errata() is dead since _query_get_snapshot_errata removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 53309f5..10fe2f9 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_errata(self):
- return self.__get_statement_data(self._query_get_snapshot_errata)
-
def __get_snapshot_ks_tree(self):
return self.__get_statement_data(self._query_get_snapshot_ks_tree)
commit 46467eb01e248acbdb90b137af92c569fc86e7d7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:44:55 2010 +0200
__get_snapshot_source_packages() is dead since _query_get_snapshot_source_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 854c1d2..53309f5 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,12 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_source_packages(self):
- h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
- h.execute(snapshot_channel_id=self.snapshot_channel_id)
- data = h.fetchall_dict() or []
- return data
-
def __get_snapshot_errata(self):
return self.__get_statement_data(self._query_get_snapshot_errata)
commit bef2edea7d580c77313f2cbd2a49a972fb8c5b05
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:43:53 2010 +0200
__get_snapshot_packages() is dead since _query_get_snapshot_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 81f1300..854c1d2 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -586,9 +586,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- def __get_snapshot_packages(self):
- return self.__get_statement_data(self._query_get_snapshot_packages)
-
def __get_snapshot_source_packages(self):
h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
h.execute(snapshot_channel_id=self.snapshot_channel_id)
commit e6ac61ec5dd7b9f070d2e2ac7b69e1811725cded
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:43:08 2010 +0200
_snapshot_channel_ks_trees() is dead since _query_snapshot_channel_ks_trees removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 30d5e67..81f1300 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,13 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_ks_trees(self, channels, channel_data):
- self._do_snapshot('ks_trees', channels, channel_data,
- self._query_snapshot_channel_ks_trees,
- with_channels=1)
- return {}
-
-
def arches(self):
return self.dump_arches(rpm_arch_type_only=1)
commit a341a0b66ec37bc0ff6731c82c7b6ba8ffc71ca7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:42:31 2010 +0200
_snapshot_channel_errata() is dead since _query_snapshot_channel_errata removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 85cd8d3..30d5e67 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_errata(self, channels, channel_data):
- self._do_snapshot('errata', channels, channel_data,
- self._query_snapshot_channel_errata)
- return {}
-
def _snapshot_channel_ks_trees(self, channels, channel_data):
self._do_snapshot('ks_trees', channels, channel_data,
self._query_snapshot_channel_ks_trees,
commit 64726e217e49544ed0f2c1d360e089bf683d6353
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:41:44 2010 +0200
_snapshot_channel_package_sources() is dead since _query_snapshot_channel_source_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 26ac75d..85cd8d3 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_package_sources(self, channels, channel_data):
- self._do_snapshot('source_packages', channels, channel_data,
- self._query_snapshot_channel_source_packages)
- return {}
-
def _snapshot_channel_errata(self, channels, channel_data):
self._do_snapshot('errata', channels, channel_data,
self._query_snapshot_channel_errata)
commit 90d5cc966bfc31f496a45264cbc3cdeeb674e395
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:40:43 2010 +0200
_snapshot_channel_packages() is dead since _query_snapshot_channel_packages removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 20fe651..26ac75d 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -206,11 +206,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- def _snapshot_channel_packages(self, channels, channel_data):
- self._do_snapshot('packages', channels, channel_data,
- self._query_snapshot_channel_packages)
- return {}
-
def _snapshot_channel_package_sources(self, channels, channel_data):
self._do_snapshot('source_packages', channels, channel_data,
self._query_snapshot_channel_source_packages)
commit b05ecf06ab791c24ae2867e6539cc7b8fdd15130
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:38:51 2010 +0200
none of rhnDumpSnapshot* exists anymore
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index ff4f71b..20fe651 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -94,14 +94,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
', '.join(["'%s'" % x for x in channel_labels]), )
return self
- _query_purge_snapshot = rhnSQL.Statement("""
- delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
- """)
- _query_snapshot_channels = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannel (id, snapshot_id, channel_id)
- values (:id, :snapshot_id, :channel_id)
- """)
-
def _get_channel_data(self, channels):
writer = ContainerWriter()
d = ChannelsDumper(writer, channels=channels.values())
@@ -214,48 +206,21 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
- _query_snapshot_channel_packages = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelPackage
- (snapshot_channel_id, package_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_packages(self, channels, channel_data):
self._do_snapshot('packages', channels, channel_data,
self._query_snapshot_channel_packages)
return {}
- _query_snapshot_channel_source_packages = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelPkgSrc
- (snapshot_channel_id, package_source_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_package_sources(self, channels, channel_data):
self._do_snapshot('source_packages', channels, channel_data,
self._query_snapshot_channel_source_packages)
return {}
- _query_snapshot_channel_errata = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelErrata
- (snapshot_channel_id, errata_id, last_modified)
- values (:snapshot_channel_id, :obj_id,
- TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS'))
- """)
def _snapshot_channel_errata(self, channels, channel_data):
self._do_snapshot('errata', channels, channel_data,
self._query_snapshot_channel_errata)
return {}
- _query_snapshot_channel_ks_trees = rhnSQL.Statement("""
- insert into rhnDumpSnapshotChannelKSTree
- (snapshot_channel_id, ks_tree_id, last_modified)
- select :snapshot_channel_id, id, TO_DATE(:last_modified, 'YYYY-MM-DD HH24:MI:SS')
- from rhnKickstartableTree
- where label = :obj_id
- and org_id is null
- and channel_id = :channel_id
- """)
def _snapshot_channel_ks_trees(self, channels, channel_data):
self._do_snapshot('ks_trees', channels, channel_data,
self._query_snapshot_channel_ks_trees,
@@ -643,52 +608,18 @@ class _ChannelDumper(exportLib.ChannelDumper):
data.sort()
return data
- _query_get_snapshot_packages = rhnSQL.Statement("""
- select dscp.package_id,
- TO_CHAR(dscp.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelPackage dscp
- where dscp.snapshot_channel_id = :snapshot_channel_id
- """)
def __get_snapshot_packages(self):
return self.__get_statement_data(self._query_get_snapshot_packages)
- _query_get_snapshot_source_packages = rhnSQL.Statement("""
- select dscps.package_source_id id,
- sr.name source_rpm,
- TO_CHAR(ps.last_modified, 'YYYYMMDDHH24MISS') last_modified
- from rhnSourceRPM sr,
- rhnPackageSource ps,
- rhnDumpSnapshotChannelPkgSrc dscps
- where dscps.snapshot_channel_id = :snapshot_channel_id
- and dscps.package_source_id = ps.id
- and ps.source_rpm_id = sr.id
- """)
def __get_snapshot_source_packages(self):
h = rhnSQL.prepare(self._query_get_snapshot_source_packages)
h.execute(snapshot_channel_id=self.snapshot_channel_id)
data = h.fetchall_dict() or []
return data
- _query_get_snapshot_errata = rhnSQL.Statement("""
- select dsce.errata_id,
- TO_CHAR(dsce.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelErrata dsce
- where dsce.snapshot_channel_id = :snapshot_channel_id
- """)
def __get_snapshot_errata(self):
return self.__get_statement_data(self._query_get_snapshot_errata)
- _query_get_snapshot_ks_tree = rhnSQL.Statement("""
- select kt.label,
- TO_CHAR(dsckt.last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
- from rhnDumpSnapshotChannelKSTree dsckt,
- rhnDumpSnapshotChannel dsc,
- rhnKickstartableTree kt
- where dsckt.snapshot_channel_id = :snapshot_channel_id
- and dsckt.ks_tree_id = kt.id
- and dsc.id = :snapshot_channel_id
- and dsc.channel_id = kt.channel_id
- """)
def __get_snapshot_ks_tree(self):
return self.__get_statement_data(self._query_get_snapshot_ks_tree)
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 1b6df11..1515473 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -81,10 +81,6 @@ rhnCryptoKeyKickstart :: rhnCryptoKey rhnKSData
rhnDevice :: rhnServer
rhnDistChannelMap :: rhnChannel rhnChannelArch
rhnDownloads :: rhnChannelFamily rhnFile rhnDownloadType
-rhnDumpSnapshotChannelErrata :: rhnDumpSnapshotChannel rhnErrata
-rhnDumpSnapshotChannelPackage :: rhnDumpSnapshotChannel rhnPackage
-rhnDumpSnapshotChannelPkgSrc :: rhnDumpSnapshotChannel rhnPackageSource
-rhnDumpSnapshotChannelKSTree :: rhnDumpSnapshotChannel rhnKickstartableTree
rhnEmailAddress :: rhnEmailAddressState web_contact
rhnEntitlementQueue :: web_customer
rhnErrata :: rhnChecksum web_customer rhnErrataSeverity
commit f9adeea76a3eb26cb419532438765af0ba480437
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:15:09 2010 +0200
_validate_channels_snapshot() is dead since _query_validate_channel_snapshot removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 9159617..ff4f71b 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -484,24 +484,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
_get_package_id = staticmethod(_get_package_id)
- def _validate_channels_snapshot(self, snapshot, channels):
- h = rhnSQL.prepare(self._query_validate_channel_snapshot)
- missing_channels = []
- snapshot_id = None
- for c in channels.values():
- channel_id = c['channel_id']
- h.execute(channel_id=channel_id, snapshot=snapshot)
- row = h.fetchone_dict()
- if row:
- snapshot_id = row['snapshot_id']
- else:
- missing_channels.append(c)
- if missing_channels:
- missing_labels = [ x['label'] for x in missing_channels ]
- raise rhnFault(3014, "snapshot: %s; channels: %s" %
- (snapshot, ' '.join(missing_labels)))
- return snapshot_id
-
def _respond_xmlrpc(self, data):
# Marshal
s = xmlrpclib.dumps((data, ))
commit c9322412ab2e8da00ad68cf25def3da17aba3527
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:13:56 2010 +0200
snapshot_channels() is dead since _snapshot_channels() removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 4db0274..9159617 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -62,7 +62,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
'get_source_rpm',
'kickstartable_trees',
'get_ks_file',
- 'snapshot_channels',
]
self.system_id = None
@@ -95,20 +94,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
', '.join(["'%s'" % x for x in channel_labels]), )
return self
- def snapshot_channels(self, snapshot, channel_labels=[], flags={}):
- """ Snapshotting channels - *does* writes in the DB """
- log_debug(2, snapshot, channel_labels)
- self.set_channel_family_query(channel_labels=channel_labels)
- channels = self._validate_channels(channel_labels=channel_labels)
- try:
- ret = self._snapshot_channels(snapshot, channels, flags)
- except:
- rhnSQL.rollback()
- raise
- else:
- rhnSQL.commit()
- return self._respond_xmlrpc(ret)
-
_query_purge_snapshot = rhnSQL.Statement("""
delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
""")
commit 3b54ca3716d14e0ecfbbfca5f3868ab5c1d1e803
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:07:49 2010 +0200
_snapshot_channels() is dead since query_lookup_snapshot and _query_create_snapshot removal
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 27993be..4db0274 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -116,61 +116,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
insert into rhnDumpSnapshotChannel (id, snapshot_id, channel_id)
values (:id, :snapshot_id, :channel_id)
""")
- def _snapshot_channels(self, snapshot, channels, flags):
- log_debug(3, snapshot, channels)
- retval = {}
- # Does the snapshot exist?
- h = rhnSQL.prepare(self._query_lookup_snapshot)
- h.execute(snapshot=snapshot)
- row = h.fetchone_dict()
- if row:
- # Did they ask to force this snapshot?
- if not flags.has_key('force'):
- # XXX
- raise Exception("did not ask for force")
- snapshot_id = row['id']
- # Remove old stuff
- h = rhnSQL.prepare(self._query_purge_snapshot)
- h.execute(snapshot_id=snapshot_id)
- else:
- snapshot_id = rhnSQL.Sequence('rhn_dump_snapshot_id_seq').next()
- h = rhnSQL.prepare(self._query_create_snapshot)
- h.execute(snapshot_id=snapshot_id, snapshot=snapshot)
-
- if not channels:
- # Nothing more to do
- # We don't exit from the very beginning because we may want to
- # clear a specific tag
- return retval
-
- channel_ids = []
- snapshot_ids = []
- snapshot_channel_ids = []
-
- seq = rhnSQL.Sequence('rhn_dump_snap_chan_id_seq')
- for channel_hash in channels.values():
- channel_id = channel_hash['channel_id']
- snapshot_channel_id = channel_hash['snapshot_channel_id'] = \
- seq.next()
-
- channel_ids.append(channel_id)
- snapshot_ids.append(snapshot_id)
- snapshot_channel_ids.append(snapshot_channel_id)
-
- h = rhnSQL.prepare(self._query_snapshot_channels)
- h.executemany(id=snapshot_channel_ids, snapshot_id=snapshot_ids,
- channel_id=channel_ids)
-
- channel_data = self._get_channel_data(channels)
- channel_data = self._lookup_last_modified(channel_data)
-
- retval.update(self._snapshot_channel_packages(channels, channel_data))
- retval.update(self._snapshot_channel_package_sources(channels,
- channel_data))
- retval.update(self._snapshot_channel_errata(channels, channel_data))
- retval.update(self._snapshot_channel_ks_trees(channels, channel_data))
-
- return retval
def _get_channel_data(self, channels):
writer = ContainerWriter()
commit e0f395fc153ddb353342e039859fb7f9f4ff8445
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri May 28 15:02:47 2010 +0200
there is no rhnDumpSnapshot table - removing dead SQL code
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index e3b7319..27993be 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -109,12 +109,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
rhnSQL.commit()
return self._respond_xmlrpc(ret)
- _query_lookup_snapshot = rhnSQL.Statement("""
- select id from rhnDumpSnapshot where snapshot = :snapshot
- """)
- _query_create_snapshot = rhnSQL.Statement("""
- insert into rhnDumpSnapshot (id, snapshot) values (:snapshot_id, :snapshot)
- """)
_query_purge_snapshot = rhnSQL.Statement("""
delete from rhnDumpSnapshotChannel where snapshot_id = :snapshot_id
""")
@@ -560,13 +554,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
_get_package_id = staticmethod(_get_package_id)
- _query_validate_channel_snapshot = rhnSQL.Statement("""
- select dsc.snapshot_id
- from rhnDumpSnapshot ds, rhnDumpSnapshotChannel dsc
- where dsc.channel_id = :channel_id
- and dsc.snapshot_id = ds.id
- and ds.snapshot = :snapshot
- """)
def _validate_channels_snapshot(self, snapshot, channels):
h = rhnSQL.prepare(self._query_validate_channel_snapshot)
missing_channels = []
@@ -694,13 +681,6 @@ class _ChannelDumper(exportLib.ChannelDumper):
log_debug(4, snapshot, incremental, self.snapshot_id,
self.snapshot_channel_id)
- _query_get_snapshot_ids = rhnSQL.Statement("""
- select ds.id snapshot_id, dsc.id snapshot_channel_id
- from rhnDumpSnapshot ds, rhnDumpSnapshotChannel dsc
- where dsc.channel_id = :channel_id
- and dsc.snapshot_id = ds.id
- and ds.snapshot = :snapshot
- """)
def init(self):
self.channel_id = self._row['id']
self.channel_label = self._row['label']
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 5300439..1b6df11 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -81,7 +81,6 @@ rhnCryptoKeyKickstart :: rhnCryptoKey rhnKSData
rhnDevice :: rhnServer
rhnDistChannelMap :: rhnChannel rhnChannelArch
rhnDownloads :: rhnChannelFamily rhnFile rhnDownloadType
-rhnDumpSnapshotChannel :: rhnDumpSnapshot rhnChannel
rhnDumpSnapshotChannelErrata :: rhnDumpSnapshotChannel rhnErrata
rhnDumpSnapshotChannelPackage :: rhnDumpSnapshotChannel rhnPackage
rhnDumpSnapshotChannelPkgSrc :: rhnDumpSnapshotChannel rhnPackageSource
12 years, 1 month
Branch 'flex-guest' - 2 commits - java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 9
java/code/src/com/redhat/rhn/common/db/datasource/xml/Procedure_queries.xml | 124 ++++++++
java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml | 2
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 13
java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml | 1
java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java | 10
java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java | 14
java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml | 5
java/code/src/com/redhat/rhn/domain/config/ConfigChannel.hbm.xml | 7
java/code/src/com/redhat/rhn/domain/config/ConfigurationFactory.java | 15
java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java | 12
java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml | 7
java/code/src/com/redhat/rhn/domain/server/ServerFactory.java | 14
java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java | 10
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/EntitlementProcedureHandler.java | 57 +++
java/code/src/com/redhat/rhn/frontend/xmlrpc/test/MockHandlerFactory.java | 1
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 4
java/code/src/com/redhat/rhn/manager/channel/ChannelProcedure.java | 12
java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java | 94 ++++++
java/code/src/com/redhat/rhn/manager/org/OrgProcedure.java | 155 ++++++++++
java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java | 13
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 18 +
22 files changed, 575 insertions(+), 22 deletions(-)
New commits:
commit 89018671ae5abaa4554483ad6a10cd27ab87ba27
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 28 13:51:53 2010 -0400
adding missing files for org removal stored procedure
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Procedure_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Procedure_queries.xml
new file mode 100644
index 0000000..d4444ab
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Procedure_queries.xml
@@ -0,0 +1,124 @@
+<datasource_modes>
+
+<write-mode name="unsubscribe_custom_channels">
+ <query params="cid">
+ delete from rhnServerChannel where channel_id = :cid
+ </query>
+</write-mode>
+
+<write-mode name="delete_server_packge_profiles_for_channel">
+ <query params="cid">
+ delete from rhnServerProfilePackage where server_profile_id in (
+ select id from rhnServerProfile where base_channel = :cid
+ )
+ </query>
+</write-mode>
+
+<write-mode name="delete_server_profiles_for_channel">
+ <query params="cid">
+ delete from rhnServerProfile where base_channel = :cid
+ </query>
+</write-mode>
+
+<write-mode name="delete_errata_packages">
+ <query params="eid">
+ delete from rhnErrataPackage where errata_id = :eid
+ </query>
+</write-mode>
+
+
+<write-mode name="delete_org_channels">
+ <query params="oid">
+ delete from rhnChannel where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_daily_summary">
+ <query params="oid">
+ delete from rhnDailySummaryQueue where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_qutoa">
+ <query params="oid">
+ delete from rhnOrgQuota where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_info">
+ <query params="oid">
+ delete from rhnOrgInfo where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_file_list">
+ <query params="oid">
+ delete from rhnFileList where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_server_group">
+ <query params="oid">
+ delete from rhnServerGroup where org_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_check_suites">
+ <query params="oid">
+ delete from rhn_check_suites where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_command_target">
+ <query params="oid">
+ delete from rhn_command_target where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_contact_group">
+ <query params="oid">
+ delete from rhn_contact_groups where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_notif_format">
+ <query params="oid">
+ delete from rhn_notification_formats where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_probe">
+ <query params="oid">
+ delete from rhn_probe where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_redirect">
+ <query params="oid">
+ delete from rhn_redirects where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_sat_cluster">
+ <query params="oid">
+ delete from rhn_sat_cluster where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org_schedule">
+ <query params="oid">
+ delete from rhn_schedules where customer_id = :oid
+ </query>
+</write-mode>
+
+<write-mode name="delete_org">
+ <query params="oid">
+ delete from web_customer where id = :oid
+ </query>
+</write-mode>
+
+
+
+
+
+</datasource_modes>
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/EntitlementProcedureHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/EntitlementProcedureHandler.java
new file mode 100644
index 0000000..2ed98f3
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/EntitlementProcedureHandler.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2010 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 com.redhat.rhn.frontend.xmlrpc.channel.internal;
+
+import com.redhat.rhn.domain.channel.Channel;
+import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.user.UserFactory;
+import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
+import com.redhat.rhn.manager.channel.ChannelManager;
+import com.redhat.rhn.manager.system.SystemManager;
+import com.redhat.rhn.manager.system.UpdateBaseChannelCommand;
+
+
+/**
+ * ChannelProcedureHandler
+ * @version $Rev$
+ */
+public class EntitlementProcedureHandler extends BaseHandler {
+
+
+ /**
+ * Runs the subscribe channel procedure
+ * @param serverId the id of the server
+ * @param channelId the id of the channel
+ * @param userId the id of the user
+ * @return 1 on success exception otherwise
+ */
+ public int subscribeChannelToSystem(Integer serverId,
+ Integer channelId, Integer userId) {
+ User user = UserFactory.lookupById(userId.longValue());
+ Channel channel = ChannelManager.lookupByIdAndUser(channelId.longValue(), user);
+ Server server = SystemManager.lookupByIdAndUser(serverId.longValue(), user);
+ if (channel.isBaseChannel()) {
+ UpdateBaseChannelCommand cmd =
+ new UpdateBaseChannelCommand(user, server, channel.getId());
+ cmd.store();
+ }
+ else {
+ SystemManager.subscribeServerToChannel(user, server, channel);
+ }
+
+ return 1;
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java b/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java
new file mode 100644
index 0000000..dfafc51
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/entitlement/EntitlementProcedure.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2009--2010 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 com.redhat.rhn.manager.entitlement;
+
+import com.redhat.rhn.domain.channel.ChannelFactory;
+import com.redhat.rhn.domain.channel.ChannelFamilyFactory;
+import com.redhat.rhn.domain.channel.PrivateChannelFamily;
+import com.redhat.rhn.domain.org.Org;
+import com.redhat.rhn.domain.org.OrgFactory;
+import com.redhat.rhn.domain.server.EntitlementServerGroup;
+import com.redhat.rhn.domain.server.ServerGroupFactory;
+import com.redhat.rhn.frontend.xmlrpc.SatelliteOrgException;
+
+import java.util.List;
+
+/**
+ *
+ * EntitlementProcedure
+ *
+ * Entitlement related procedures
+ * @version $Rev$
+ */
+public class EntitlementProcedure {
+
+
+ private static final EntitlementProcedure INSTANCE = new EntitlementProcedure();
+
+ private EntitlementProcedure() {
+
+ }
+
+ /**
+ * @return an instance of the EntitlementProcedure object
+ */
+ public static EntitlementProcedure getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Remove All entitlements from an org
+ * Just handles the math logic, doesn't actually unsubscribe any systems
+ * @param orgId The orgId
+ */
+ public void removeOrgEntitlements(Long orgId) {
+ if (orgId.equals(1L)) {
+ throw new SatelliteOrgException();
+ }
+
+
+ Org org = OrgFactory.lookupById(orgId);
+ Org masterOrg = OrgFactory.lookupById(1L);
+
+
+ //For each Entitlement take the Max for the org, and return it to the
+ // master org, locking both rows since we update and read them both.
+ List<EntitlementServerGroup> systemEnts =
+ ServerGroupFactory.listEntitlementGroups(org);
+ for (EntitlementServerGroup sysEnt : systemEnts) {
+ EntitlementServerGroup masterEnt = ServerGroupFactory.lookupEntitled(
+ masterOrg, sysEnt.getGroupType());
+ ServerGroupFactory.lockEntitledServerGroup(sysEnt);
+ ServerGroupFactory.lockEntitledServerGroup(masterEnt);
+ masterEnt.setMaxMembers(masterEnt.getMaxMembers() + sysEnt.getMaxMembers());
+ sysEnt.setMaxMembers(0L);
+ }
+
+
+ //Do the same for the Channel entitlements
+ List<PrivateChannelFamily> privChannels =
+ ChannelFamilyFactory.listPrivateChannelFamiles(org);
+ for (PrivateChannelFamily priv : privChannels) {
+ PrivateChannelFamily masterFam =
+ priv.getChannelFamily().getChannelFamilyAllocationFor(masterOrg);
+ ChannelFactory.lockPrivateChannelFamily(priv);
+ ChannelFactory.lockPrivateChannelFamily(masterFam);
+ masterFam.setMaxMembers(masterFam.getMaxMembers() + priv.getMaxMembers());
+ priv.setMaxMembers(0L);
+ }
+
+ }
+
+}
diff --git a/java/code/src/com/redhat/rhn/manager/org/OrgProcedure.java b/java/code/src/com/redhat/rhn/manager/org/OrgProcedure.java
new file mode 100644
index 0000000..bc3e13f
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/org/OrgProcedure.java
@@ -0,0 +1,155 @@
+/**
+ * Copyright (c) 2009--2010 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 com.redhat.rhn.manager.org;
+
+import com.redhat.rhn.common.db.datasource.CallableMode;
+import com.redhat.rhn.common.db.datasource.ModeFactory;
+import com.redhat.rhn.common.db.datasource.WriteMode;
+import com.redhat.rhn.domain.config.ConfigChannel;
+import com.redhat.rhn.domain.config.ConfigurationFactory;
+import com.redhat.rhn.domain.errata.ErrataFactory;
+import com.redhat.rhn.domain.org.Org;
+import com.redhat.rhn.domain.server.ServerFactory;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.domain.user.UserFactory;
+import com.redhat.rhn.frontend.dto.ChannelOverview;
+import com.redhat.rhn.frontend.dto.SystemOverview;
+import com.redhat.rhn.frontend.xmlrpc.SatelliteOrgException;
+import com.redhat.rhn.manager.channel.ChannelManager;
+import com.redhat.rhn.manager.entitlement.EntitlementProcedure;
+import com.redhat.rhn.manager.system.SystemManager;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * OrgProcedure
+ *
+ * Organization related procedures
+ *
+ * @version $Rev$
+ */
+public class OrgProcedure {
+
+
+ private static final OrgProcedure INSTANCE = new OrgProcedure();
+
+ private OrgProcedure() {
+
+ }
+
+ /**
+ * @return an instance of the OrgProcedure object
+ */
+ public static OrgProcedure getInstance() {
+ return INSTANCE;
+ }
+
+
+
+ /**
+ * Delete an Org
+ * @param org The org to delete
+ */
+ public static void deleteOrg(Org org) {
+
+ if (org.getId() == 1) {
+ throw new SatelliteOrgException();
+ }
+
+ List<User> users = UserFactory.getInstance().findAllUsers(org);
+ for (User u : users) {
+ CallableMode m = ModeFactory.getCallableMode("User_queries",
+ "delete_user");
+ Map inParams = new HashMap();
+ Map outParams = new HashMap();
+ inParams.put("user_id", u.getId());
+ m.execute(inParams, outParams);
+ }
+
+ List<SystemOverview> systems = SystemManager.systemListShort(org, null);
+ for (SystemOverview sys : systems) {
+ ServerFactory.delete(sys.getId());
+ }
+
+ List<ConfigChannel> configChannels = ConfigurationFactory.listConfigChannels(org);
+ for (ConfigChannel config : configChannels) {
+ ConfigurationFactory.removeConfigChannel(config);
+ }
+
+ List<ChannelOverview> channels =
+ ChannelManager.channelsOwnedByOrg(org.getId(), null);
+ for (ChannelOverview chan : channels) {
+ deleteCustomChannelAssociations(chan.getId());
+ }
+
+
+ List<Long> errata = ErrataFactory.listErrataIds(org);
+ for (Long e : errata) {
+ deleteErrataPackage(e);
+ }
+
+ EntitlementProcedure.getInstance().removeOrgEntitlements(org.getId());
+
+ String[] modes = {"delete_org_channels",
+ "delete_org_daily_summary",
+ "delete_org_qutoa",
+ "delete_org_info",
+ "delete_org_file_list",
+ "delete_org_server_group",
+ "delete_org_check_suites",
+ "delete_org_command_target",
+ "delete_org_contact_group",
+ "delete_org_notif_format",
+ "delete_org_probe",
+ "delete_org_redirect",
+ "delete_org_sat_cluster",
+ "delete_org_schedule",
+ "delete_org"};
+
+ Map params = new HashMap();
+ params.put("oid", org.getId());
+ for (String mode : modes) {
+ WriteMode m = ModeFactory.getWriteMode("Procedure_queries", mode);
+ m.executeUpdate(params);
+ }
+
+
+ }
+
+ private static void deleteCustomChannelAssociations(Long cid) {
+ String[] modes = {"unsubscribe_custom_channels",
+ "delete_server_packge_profiles_for_channel",
+ "delete_server_profiles_for_channel"};
+
+ Map params = new HashMap();
+ params.put("cid", cid);
+ for (String mode : modes) {
+ WriteMode m = ModeFactory.getWriteMode("Procedure_queries", mode);
+ m.executeUpdate(params);
+ }
+ }
+
+ private static void deleteErrataPackage(Long eid) {
+ Map params = new HashMap();
+ params.put("eid", eid);
+ WriteMode m = ModeFactory.getWriteMode("Procedure_queries",
+ "delete_errata_packages");
+ m.executeUpdate(params);
+ }
+
+}
commit 92d967985d8c758d3c10c4300ee1e415d32134af
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Fri May 28 13:51:28 2010 -0400
adding remove org stored procedure
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 0cf52fd..c482685 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -1230,15 +1230,6 @@ GROUP BY C.id, C.name
</mode>
-<mode name="lock_current_members">
- <query params="org_id, cfid">
- select current_members
- from rhnPrivateChannelFamily
- where org_id = :org_id and channel_family_id = :cfid
- for update of current_members
- </query>
-</mode>
-
<mode name="compute_channel_family_curent_members">
<query params="org_id, cfid">
select count(distinct server_id) as count
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
index f86a511..d1ae64c 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/SystemGroup_queries.xml
@@ -158,4 +158,6 @@ SELECT SUM(max_members - current_members) AS available
</query>
</mode>
+
+
</datasource_modes>
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 9d89f37..7e187a1 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -398,6 +398,19 @@ ORDER BY UPPER(NVL(S.name, '(none)')), S.id
</query>
</mode>
+<mode name="visible_to_org" class="com.redhat.rhn.frontend.dto.SystemOverview">
+ <query params="org_id">
+ SELECT DISTINCT S.id AS ID,
+ S.name AS NAME,
+ INFO.checkin AS LAST_CHECKIN
+ FROM rhnServer S, rhnServerInfo INFO
+ WHERE
+ S.org_id = :org_id
+ S.id = INFO.server_id
+ </query>
+</mode>
+
+
<mode name="visible_to_user_from_sysid_list" class="com.redhat.rhn.frontend.dto.SystemSearchResult">
<query name="available_to_user_from_sysid_list" />
<elaborator name="system_overview" />
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml
index c5ec1f0..d789dd1 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml
@@ -23,6 +23,7 @@
<template name="ssm_operation_queries" filename="xml/ssm_operation_queries.xml" />
<template name="util_queries" filename="xml/util_queries.xml" />
<template name="ErrataCache_queries" filename="xml/ErrataCache_queries.xml" />
+ <template name="Procedure_queries" filename="xml/Procedure_queries.xml" />
<!-- queries used to test the datasource system -->
<template name="test_queries" filename="xml/test_queries.xml" />
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
index 5fbc56b..269a7d2 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
@@ -25,6 +25,7 @@ import java.util.Set;
import org.apache.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
+import org.hibernate.LockMode;
import org.hibernate.Session;
import org.hibernate.criterion.CriteriaSpecification;
import org.hibernate.criterion.Projections;
@@ -932,4 +933,13 @@ public class ChannelFactory extends HibernateFactory {
criteria.add(Restrictions.eq("channel", ch));
return (Integer)criteria.uniqueResult() > 0;
}
+
+ /**
+ * Lock a private channel family object
+ * @param priv the private channel family
+ */
+ public static void lockPrivateChannelFamily(PrivateChannelFamily priv) {
+ getSession().lock(priv, LockMode.UPGRADE);
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
index f414335..3eac0ca 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
@@ -138,6 +138,20 @@ public class ChannelFamilyFactory extends HibernateFactory {
return cfam;
}
+
+ /**
+ * Get a list of all PrivateChannelFamiles for an org. Not just their special one
+ * @param org the org
+ * @return list of PrivateChannelFamiles
+ */
+ public static List<PrivateChannelFamily> listPrivateChannelFamiles(Org org) {
+ Map params = new HashMap();
+ params.put("orgId", org.getId());
+ return (List<PrivateChannelFamily>) singleton.listObjectsByNamedQuery(
+ "PrivateChannelFamily.findByOrg", params);
+
+ }
+
/**
* Checks if the org has permission to its channel family.
* If it does not, grants permissions.
diff --git a/java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml
index aaeb897..62a6f7b 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/PrivateChannelFamily.hbm.xml
@@ -20,4 +20,9 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<property name="modified" column="MODIFIED" not-null="true"
type="timestamp" insert="false" update="false" />
</class>
+
+ <query name="PrivateChannelFamily.findByOrg">
+ <![CDATA[from com.redhat.rhn.domain.channel.PrivateChannelFamily as cfam where cfam.org.id = :orgId]]>
+ </query>
+
</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/domain/config/ConfigChannel.hbm.xml b/java/code/src/com/redhat/rhn/domain/config/ConfigChannel.hbm.xml
index 6d249d0..2ac0e4c 100644
--- a/java/code/src/com/redhat/rhn/domain/config/ConfigChannel.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/config/ConfigChannel.hbm.xml
@@ -34,4 +34,11 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<one-to-many class="com.redhat.rhn.domain.config.ConfigFile"/>
</set>
</class>
+
+ <query name="ConfigChannel.listByOrg">
+ <![CDATA[
+ from com.redhat.rhn.domain.config.ConfigChannel as c where c.org = :org
+ ]]>
+ </query>
+
</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/domain/config/ConfigurationFactory.java b/java/code/src/com/redhat/rhn/domain/config/ConfigurationFactory.java
index 391a4d5..381732b 100644
--- a/java/code/src/com/redhat/rhn/domain/config/ConfigurationFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/config/ConfigurationFactory.java
@@ -36,6 +36,7 @@ import java.io.InputStream;
import java.sql.Types;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -427,6 +428,20 @@ public class ConfigurationFactory extends HibernateFactory {
.uniqueResult();
}
+
+ /**
+ * List all Config channels for an org
+ * @param org the org
+ * @return the config chanenls
+ */
+ public static List<ConfigChannel> listConfigChannels(Org org) {
+ Session session = HibernateFactory.getSession();
+ Map params = new HashMap();
+ params.put("org", org);
+ return singleton.listObjectsByNamedQuery("ConfigChannel.listByOrg", params);
+ }
+
+
/**
* Used to look up ConfigFileStates. Note: there is a static list of
* ConfigFileStates and therefore a static list of labels. This method
diff --git a/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java b/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
index b6b8038..adb09a6 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/errata/ErrataFactory.java
@@ -1042,6 +1042,18 @@ public class ErrataFactory extends HibernateFactory {
new HashMap(), ids, "list");
}
+ /**
+ * List errata objects by ID
+ * @param org the org
+ * @return List of longs
+ */
+ public static List<Long> listErrataIds(Org org) {
+ Map params = new HashMap();
+ params.put("org", org);
+ return singleton.listObjectsByNamedQuery("PublishedErrata.listIdsByOrg",
+ params);
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
index b305f66..6420dd2 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/errata/impl/PublishedErrata.hbm.xml
@@ -103,6 +103,13 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
where c.original = :original
and c.org = :org]]>
</query>
+ <query name="PublishedErrata.listIdsByOrg">
+ <return-scalar type="long" column="id"/>
+ <![CDATA[
+ Select e.id as id
+ from com.redhat.rhn.domain.errata.impl.PublishedErrata as e
+ where e.org = :org]]>
+ </query>
<query name="PublishedErrata.findByAdvisory">
<![CDATA[from com.redhat.rhn.domain.errata.impl.PublishedErrata as e
where e.advisory = :advisory]]>
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
index c8aa4d1..a5ba37c 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerFactory.java
@@ -337,14 +337,24 @@ public class ServerFactory extends HibernateFactory {
*/
public static void delete(Server server) {
HibernateFactory.getSession().evict(server);
+ delete(server.getId());
+ HibernateFactory.getSession().evict(server);
+ }
+
+ /**
+ * Deletes a server
+ *
+ * @param serverId The server to delete
+ */
+ public static void delete(Long serverId) {
CallableMode m = ModeFactory.getCallableMode("System_queries",
"delete_server");
Map in = new HashMap();
- in.put("server_id", server.getId());
+ in.put("server_id", serverId);
m.execute(in, new HashMap());
- HibernateFactory.getSession().evict(server);
}
+
private static void updateServerPerms(Server server) {
CallableMode m = ModeFactory.getCallableMode("System_queries",
"update_perms_for_server");
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java b/java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java
index 18d4cbb..0a4b371 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerGroupFactory.java
@@ -22,6 +22,7 @@ import com.redhat.rhn.domain.user.User;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
+import org.hibernate.LockMode;
import org.hibernate.Session;
import java.util.ArrayList;
@@ -335,4 +336,13 @@ public class ServerGroupFactory extends HibernateFactory {
params.put("threshold", threshold);
return SINGLETON.listObjectsByNamedQuery(query, params);
}
+
+ /**
+ * Lock an EntitlementServerGroup for update
+ * @param grp the server group
+ */
+ public static void lockEntitledServerGroup(EntitlementServerGroup grp) {
+ getSession().lock(grp, LockMode.UPGRADE);
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/test/MockHandlerFactory.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/test/MockHandlerFactory.java
index 2f834fc..4f1ce9d 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/test/MockHandlerFactory.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/test/MockHandlerFactory.java
@@ -14,7 +14,6 @@
*/
package com.redhat.rhn.frontend.xmlrpc.test;
-import com.redhat.rhn.common.util.manifestfactory.ClassBuilder;
import com.redhat.rhn.frontend.xmlrpc.HandlerFactory;
/**
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
index b6835ec..f53e716 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
@@ -684,7 +684,8 @@ public class ChannelManager extends BaseManager {
* @param pc page control for the user
* @return Returns a data result containing ChannelOverview dtos
*/
- public static DataResult channelsOwnedByOrg(Long orgId, PageControl pc) {
+ public static DataResult<ChannelOverview> channelsOwnedByOrg(Long orgId,
+ PageControl pc) {
SelectMode m = ModeFactory.getMode("Channel_queries",
"channels_owned_by_org");
Map params = new HashMap();
@@ -2905,4 +2906,5 @@ public class ChannelManager extends BaseManager {
return toRet;
}
+
}
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelProcedure.java b/java/code/src/com/redhat/rhn/manager/channel/ChannelProcedure.java
index 829a690..7b4aed4 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelProcedure.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelProcedure.java
@@ -20,6 +20,7 @@ import com.redhat.rhn.common.db.datasource.SelectMode;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.security.PermissionException;
import com.redhat.rhn.domain.channel.Channel;
+import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.channel.ChannelFamily;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.server.Server;
@@ -134,7 +135,8 @@ public class ChannelProcedure {
Org org = (channel.getOrg() == null) ? server.getOrg() : channel.getOrg();
//need do a select for update Lock on current Members
- lockCurrentMembers(channel.getChannelFamily(), org);
+ ChannelFactory.lockPrivateChannelFamily(
+ channel.getChannelFamily().getChannelFamilyAllocationFor(org));
if (channel.getChannelFamily().hasAvailableSlots(org) ||
canConsumeVirtChannels(server, channel)) {
ServerHistoryEvent event = new ServerHistoryEvent();
@@ -183,14 +185,6 @@ public class ChannelProcedure {
}
}
- private void lockCurrentMembers(ChannelFamily channelFamilyIn, Org orgIn) {
- SelectMode m = ModeFactory.getMode("Channel_queries",
- "lock_current_members");
- Map params = new HashMap();
- params.put("org_id", orgIn.getId());
- params.put("cfid", channelFamilyIn.getId());
- m.execute(params);
- }
private void updateChannelFamilyCounts(ChannelFamily channelFamilyIn,
Org orgIn) {
diff --git a/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java b/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
index f629618..b388f5e 100644
--- a/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/ServerGroupManager.java
@@ -441,4 +441,17 @@ public class ServerGroupManager {
public List<Long> listInactiveServers(ServerGroup sg, Long threshold) {
return ServerGroupFactory.listInactiveServerIds(sg, threshold);
}
+
+ /**
+ * Lock a given server group
+ * @param serverGroup the server group to lock
+ */
+ public static void lockServerGroup(EntitlementServerGroup serverGroup) {
+ SelectMode m = ModeFactory.getMode("ServerGroup_queries",
+ "lock_group_row");
+ Map params = new HashMap();
+ params.put("gid", serverGroup.getId());
+ m.execute(params);
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
index edeb6d5..5e099d5 100644
--- a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
@@ -330,6 +330,24 @@ public class SystemManager extends BaseManager {
}
/**
+ * Returns list of all systems visible to the org
+ * Ignores user permissions
+ * @param org the org
+ * @param pc PageControl
+ * @return list of SystemOverviews.
+ */
+ public static DataResult<SystemOverview> systemListShort(Org org, PageControl pc) {
+ SelectMode m = ModeFactory.getMode("System_queries", "visible_to_org",
+ SystemOverview.class);
+ Map params = new HashMap();
+ params.put("org_id", org.getId());
+ Map elabParams = new HashMap();
+
+ return makeDataResult(params, elabParams, pc, m);
+ }
+
+
+ /**
* Returns list of all systems that are visible to user
* but not in the given server group.
* @param user Currently logged in user.
12 years, 1 month