Branch 'fve' - 28 commits - backend/satellite_exporter backend/satellite_tools backend/spacewalk-backend.spec client/rhel java/code rel-eng/packages schema/spacewalk web/html web/modules
by Partha Aji
backend/satellite_exporter/handlers/non_auth_dumper.py | 285 ++++++++--
backend/satellite_tools/disk_dumper/dumper.py | 264 ---------
backend/satellite_tools/disk_dumper/iss.py | 40 +
backend/spacewalk-backend.spec | 6
client/rhel/rhn-client-tools/po/ru.po | 285 +++++-----
client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 5
client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py | 49 +
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 50 -
java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java | 2
java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java | 4
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 115 ++--
java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java | 10
rel-eng/packages/spacewalk-backend | 2
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/Server.pm | 60 --
web/modules/rhn/RHN/DB/ServerActions.pm | 42 -
web/modules/sniglets/Sniglets/Channel.pm | 68 --
web/modules/sniglets/Sniglets/ListView/SystemList.pm | 84 --
23 files changed, 585 insertions(+), 1019 deletions(-)
New commits:
commit 1df1621eb2147537d3dd31a952c5b41efc233562
Merge: 057b94d... 59a24c7...
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Jun 8 19:43:28 2010 -0400
Merge branch 'master' into fve
diff --cc schema/spacewalk/oracle/packages/rhn_channel.pkb
index 53894ac,f5d5c96..1438f8c
--- a/schema/spacewalk/oracle/packages/rhn_channel.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pkb
@@@ -259,31 -239,7 +259,22 @@@ I
end;
+ FUNCTION can_server_consume_fve(server_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ CURSOR vi_entries IS
+ SELECT *
+ FROM rhnVirtualInstance
+ WHERE virtual_system_id = server_id_in;
+ vi_count NUMBER;
+
+ BEGIN
+ FOR vi_entry IN VI_ENTRIES LOOP
+ return 1;
+ END LOOP;
+ RETURN 0;
+ 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
commit 59a24c76ec52099cdea609e94923d3af4e34c57e
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;
commit 9a8fd0ea078028d26f273d1c61f2f2409e7a119d
Author: Partha Aji <paji(a)redhat.com>
Date: Thu May 27 20:23:29 2010 -0400
removed an unused method
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 2163844..1bde1f5 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -1764,66 +1764,6 @@ sub can_entitle_server {
return $can ? 1 : 0;
}
-sub set_channels {
- my $self = shift;
- my %params = validate(@_, {user_id => 1, channels => 1});
- my %new_channels = map { $_ => 1 } @{$params{channels}};
- my $user_id = $params{user_id};
-
- my @remove;
- my @add;
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOS;
-SELECT SC.channel_id
- FROM rhnServerChannel SC
- WHERE SC.server_id = ?
-EOS
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- while (my ($cid) = $sth->fetchrow) {
- if (exists $new_channels{$cid}) {
- delete $new_channels{$cid};
- }
- else {
- push @remove, $cid;
- }
- }
-
- @add = keys %new_channels;
- foreach my $add (@add) {
-
- # do quick unsubscribe + quick subscribe
- my $sth = $dbh->prepare(<<EOS);
-BEGIN
- rhn_channel.unsubscribe_server(:server_id, :cid, 0);
- rhn_channel.subscribe_server(:server_id, :cid, 0, :user_id);
-END;
-EOS
- $sth->execute_h(server_id => $self->id, cid => $add, user_id => $user_id);
- }
-
- foreach my $remove (@remove) {
- # do quick unsubscribes
- my $sth = $dbh->prepare(<<EOS);
-BEGIN
- rhn_channel.unsubscribe_server(:server_id, :cid, 0);
-END;
-EOS
- $sth->execute_h(server_id => $self->id, cid => $remove);
- }
-
- # manually recompute the cache so that it's immediate
- my ($add, $remove, $unc) = RHN::DB::Server->update_cache_for_server($dbh, $self->id);
-
- $dbh->commit;
-
- return { added => [ @add ],
- removed => [ @remove ],
- };
-}
sub entitle_server {
my $self_or_class = shift;
commit ee10f6731672b225976fdb70a5123f40f6d8cf89
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 17:09:05 2010 +0200
591291 - associate packages also (when mergeing errata)
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index f8072e2..92767ef 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -1844,7 +1844,14 @@ public class ChannelSoftwareHandler extends BaseHandler {
}
ErrataManager.publishErrataToChannel(toChannel, getErrataIds(diffErrata), user);
+ for (Errata errata : diffErrata) {
+ for (Iterator iter = errata.getPackages().iterator(); iter.hasNext();) {
+ Package pkg = (Package) iter.next();
+ toChannel.addPackage(pkg, user);
+ }
+ }
ChannelFactory.save(toChannel);
+ ChannelManager.refreshWithNewestPackages(toChannel, "api");
return diffErrata;
}
commit 7e92f8c7ae1254400cc7285a47166e980922982e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:51:46 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.20-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 103f39f..3347bfb 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.19
+Version: 1.1.20
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -631,6 +631,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue Jun 08 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.20-1
+- more exporter code cleanup
+- 589524 - select packages, erratas and kickstart trees according to import
+
* Thu Jun 03 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.19-1
- removed duplicated code from export routines
* Mon May 31 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.18-1
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 3d31023..e29d7aa 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.19-1 backend/
+1.1.20-1 backend/
commit 2b1c8029989b474914326754b4e2b97475c8fe92
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:48:10 2010 +0200
_get_package_id() not used anywhere
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index b7f70f0..e52f93a 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -657,21 +657,6 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
def close_rpm(self):
self._is_closed = 1
- def _get_package_id(package, prefix):
- """ Extracts the package id from a string rhn-package-12345 """
- log_debug(4, package, prefix)
- if package[:len(prefix)] != prefix:
- raise rhnFault(3002, "Invalid package name %s" % package)
- package_id = package[len(prefix):]
- try:
- package_id = int(package_id)
- except ValueError:
- raise rhnFault(3002, "Invalid package id %s" % package)
- return package_id
-
- _get_package_id = staticmethod(_get_package_id)
-
-
def _respond_xmlrpc(self, data):
# Marshal
s = xmlrpclib.dumps((data, ))
commit 1a55283cc3dbbe182f8e41a8836b9aa794650762
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:41:30 2010 +0200
if we inherit from dumper.ChannelsDumper, we can even remove set_iterator()
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index e503ac9..b7f70f0 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -734,16 +734,7 @@ class ContainerWriter:
# Overwrite the ChannelsDumper class to filter packages/source packages/errata
# based on the creation date
# XXX No caching for now
-class ChannelsDumper(exportLib.ChannelsDumper):
- def set_iterator(self):
- if not self._channels:
- # Nothing to do
- return
-
- # Import the query from the dumper.ChannelsDumper class
- h = rhnSQL.prepare(dumper.ChannelsDumper._query_list_channels)
- return dumper.QueryIterator(statement=h, params=self._channels)
-
+class ChannelsDumper(dumper.ChannelsDumper):
def dump_subelement(self, data):
c = exportLib.ChannelDumper(self._writer, data)
c.dump()
commit b3a48f60786a4db76b51b66b4978139e4db65086
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:35:42 2010 +0200
removed useless try-except
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index f23c355..e503ac9 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -746,10 +746,7 @@ class ChannelsDumper(exportLib.ChannelsDumper):
def dump_subelement(self, data):
c = exportLib.ChannelDumper(self._writer, data)
- try:
- c.dump()
- except:
- raise
+ c.dump()
_query_lookup_last_modified_packages = rhnSQL.Statement("""
select TO_CHAR(last_modified, 'YYYY-MM-DD HH24:MI:SS') last_modified
commit 974fff4e84936810a33a54bfceaa8b7b312ac2ce
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:34:29 2010 +0200
superclass' __init__() is called by default
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index c9efa0f..f23c355 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -735,11 +735,6 @@ class ContainerWriter:
# based on the creation date
# XXX No caching for now
class ChannelsDumper(exportLib.ChannelsDumper):
- 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)
-
def set_iterator(self):
if not self._channels:
# Nothing to do
commit db705d2b3bae84b7abaedc647a6d8880c6188cb5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:22:38 2010 +0200
fixed namespace in moved funcitions
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index c4bd142..c9efa0f 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -285,10 +285,10 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
h.execute()
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
+ d = dumper.SatelliteDumper(writer,
exportLib.ChannelFamiliesDumper(writer,
data_iterator=h, null_max_members=0, virt_filter=virt_filter),)
- dumper.dump()
+ d.dump()
writer.flush()
log_debug(4, "OK")
self.close()
@@ -299,9 +299,9 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
channels = self._validate_channels(channel_labels=channel_labels)
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer, ChannelsDumperEx(writer,
+ d = dumper.SatelliteDumper(writer, dumper.ChannelsDumperEx(writer,
channels=channels.values()))
- dumper.dump()
+ d.dump()
writer.flush()
log_debug(4, "OK")
self.close()
@@ -352,7 +352,7 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
except IOError:
log_error("Client disconnected prematurely")
self.close()
- raise ClosedConnectionError
+ raise dumper.ClosedConnectionError
# We're done
return 0
@@ -384,9 +384,9 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
packages_hash[package_id] = row
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
+ d = dumper.SatelliteDumper(writer,
dump_class(writer, packages_hash.values()))
- dumper.dump()
+ d.dump()
writer.flush()
log_debug(4, "OK")
self.close()
@@ -420,9 +420,9 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
errata_hash[errata_id] = row
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- ErrataDumper(writer, errata_hash.values()))
- dumper.dump()
+ d = dumper.SatelliteDumper(writer,
+ dumper.ErrataDumper(writer, errata_hash.values()))
+ d.dump()
writer.flush()
log_debug(4, "OK")
self.close()
@@ -434,9 +434,9 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
kickstart_labels=kickstart_labels)
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- KickstartableTreesDumper(writer, kickstarts=kickstarts))
- dumper.dump()
+ d = dumper.SatelliteDumper(writer,
+ dumper.KickstartableTreesDumper(writer, kickstarts=kickstarts))
+ d.dump()
writer.flush()
log_debug(4, "OK")
self.close()
@@ -445,8 +445,8 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
def dump_product_names(self):
log_debug(4)
writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer, exportLib.ProductNamesDumper(writer))
- dumper.dump()
+ d = dumper.SatelliteDumper(writer, exportLib.ProductNamesDumper(writer))
+ d.dump()
writer.flush()
self.close()
return 0
commit f44cda03d238d7cc4742258538bf0fa7466d5797
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 16:00:53 2010 +0200
removed empty XML_DumperEx
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 6c36381..c4bd142 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -38,7 +38,7 @@ class NullPathPackageError(Exception):
class MissingPackageError(Exception):
pass
-class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
+class NonAuthenticatedDumper(rhnHandler, dumper.XML_Dumper):
def __init__(self, req):
rhnHandler.__init__(self)
self.compress_level = 5
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index e9dbaaa..91a7e98 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -533,9 +533,6 @@ class XML_Dumper:
return result
-class XML_DumperEx(XML_Dumper):
- pass
-
class SatelliteDumper(exportLib.SatelliteDumper):
def set_attributes(self):
""" Overriding with our own version """
commit c7c71e8bed064746f6ba8d60aed5fd605a9ef8f2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 15:58:29 2010 +0200
moved dump_channel_families(), dump_channels(), dump_channel_packages_short(), _packages(), dump_errata(), dump_kickstartable_trees() and dump_product_names() to NonAuthenticatedDumper
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 3177bb0..6c36381 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -277,6 +277,180 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
h.executemany(snapshot_channel_id=snapshot_channel_ids,
obj_id=obj_ids, last_modified=last_modifieds)
+ # Dumper functions here
+ def dump_channel_families(self, virt_filter=0):
+ log_debug(2)
+
+ h = self.get_channel_families_statement()
+ h.execute()
+
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer,
+ exportLib.ChannelFamiliesDumper(writer,
+ data_iterator=h, null_max_members=0, virt_filter=virt_filter),)
+ dumper.dump()
+ writer.flush()
+ log_debug(4, "OK")
+ self.close()
+ return 0
+
+ def dump_channels(self, channel_labels=None):
+ log_debug(2)
+ channels = self._validate_channels(channel_labels=channel_labels)
+
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer, ChannelsDumperEx(writer,
+ channels=channels.values()))
+ dumper.dump()
+ writer.flush()
+ log_debug(4, "OK")
+ self.close()
+ return 0
+
+ def dump_channel_packages_short(self, channel_label, last_modified):
+ log_debug(2, channel_label)
+ channels = self._validate_channels(channel_labels=[channel_label])
+ channel_obj = channels[channel_label]
+ db_last_modified = int(rhnLib.timestamp(channel_obj['last_modified']))
+ last_modified = int(rhnLib.timestamp(last_modified))
+ log_debug(3, "last modified", last_modified, "db last modified",
+ db_last_modified)
+ if last_modified != db_last_modified:
+ raise rhnFault(3013, "The requested channel version does not match"
+ " the upstream version", explain=0)
+ channel_id = channel_obj['channel_id']
+ key = "xml-channel-packages/rhn-channel-%d.data" % channel_id
+ # Try to get everything off of the cache
+ val = rhnCache.get(key, compressed=0, raw=1, modified=last_modified)
+ if val is None:
+ # Not generated yet
+ log_debug(4, "Cache MISS for %s (%s)" % (channel_label,
+ channel_id))
+ stream = self._cache_channel_packages_short(channel_id, key,
+ last_modified)
+ else:
+ log_debug(4, "Cache HIT for %s (%s)" % (channel_label,
+ channel_id))
+ temp_stream = tempfile.TemporaryFile()
+ temp_stream.write(val)
+ temp_stream.flush()
+ stream = self._normalize_compressed_stream(temp_stream)
+
+ # Copy the results to the output stream
+ # They shold be already compressed if they were requested to be
+ # compressed
+ buffer_size = 16384
+ # Send the HTTP headers - but don't init the compressed stream since
+ # we send the data ourselves
+ self._send_headers(init_compressed_stream=0)
+ while 1:
+ buff = stream.read(buffer_size)
+ if not buff:
+ break
+ try:
+ self._raw_stream.write(buff)
+ except IOError:
+ log_error("Client disconnected prematurely")
+ self.close()
+ raise ClosedConnectionError
+ # We're done
+ return 0
+
+ def _packages(self, packages, prefix, dump_class, sources=0):
+ if sources:
+ h = self.get_source_packages_statement()
+ else:
+ h = self.get_packages_statement()
+
+ packages_hash = {}
+ for package in packages:
+ package = str(package)
+ if package[:len(prefix)] != prefix:
+ raise rhnFault(3002, "Invalid package name %s" % package)
+ package_id = package[len(prefix):]
+ try:
+ package_id = int(package_id)
+ except ValueError:
+ raise rhnFault(3002, "Invalid package name %s" % package)
+ if packages_hash.has_key(package_id):
+ # Already verified
+ continue
+ h.execute(package_id=package_id)
+ row = h.fetchone_dict()
+ if not row:
+ # XXX Silently ignore it?
+ raise rhnFault(3003, "No such package %s" % package)
+ # Saving the row, it's handy later when we create the iterator
+ packages_hash[package_id] = row
+
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer,
+ dump_class(writer, packages_hash.values()))
+ dumper.dump()
+ writer.flush()
+ log_debug(4, "OK")
+ self.close()
+ return 0
+
+ def dump_errata(self, errata):
+ log_debug(2)
+
+ h = self.get_errata_statement()
+
+ errata_hash = {}
+ prefix = 'rhn-erratum-'
+ for erratum in errata:
+ erratum = str(erratum)
+ if erratum[:len(prefix)] != prefix:
+ raise rhnFault(3004, "Wrong erratum name %s" % erratum)
+ errata_id = erratum[len(prefix):]
+ try:
+ errata_id = int(errata_id)
+ except ValueError:
+ raise rhnFault(3004, "Wrong erratum name %s" % erratum)
+ if errata_hash.has_key(errata_id):
+ # Already verified
+ continue
+ h.execute(errata_id=errata_id)
+ row = h.fetchone_dict()
+ if not row:
+ # XXX Silently ignore it?
+ raise rhnFault(3005, "No such erratum %s" % erratum)
+ # Saving the row, it's handy later when we create the iterator
+ errata_hash[errata_id] = row
+
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer,
+ ErrataDumper(writer, errata_hash.values()))
+ dumper.dump()
+ writer.flush()
+ log_debug(4, "OK")
+ self.close()
+ return 0
+
+ def dump_kickstartable_trees(self, kickstart_labels=None):
+ log_debug(2)
+ kickstarts = self._validate_kickstarts(
+ kickstart_labels=kickstart_labels)
+
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer,
+ KickstartableTreesDumper(writer, kickstarts=kickstarts))
+ dumper.dump()
+ writer.flush()
+ log_debug(4, "OK")
+ self.close()
+ return 0
+
+ def dump_product_names(self):
+ log_debug(4)
+ writer = self._get_xml_writer()
+ dumper = SatelliteDumper(writer, exportLib.ProductNamesDumper(writer))
+ dumper.dump()
+ writer.flush()
+ self.close()
+ return 0
+
def arches(self):
return self.dump_arches(rpm_arch_type_only=1)
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index c081212..e9dbaaa 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -534,179 +534,7 @@ class XML_Dumper:
return result
class XML_DumperEx(XML_Dumper):
- # Dumper functions here
- def dump_channel_families(self, virt_filter=0):
- log_debug(2)
-
- h = self.get_channel_families_statement()
- h.execute()
-
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- exportLib.ChannelFamiliesDumper(writer,
- data_iterator=h, null_max_members=0, virt_filter=virt_filter),)
- dumper.dump()
- writer.flush()
- log_debug(4, "OK")
- self.close()
- return 0
-
- def dump_channels(self, channel_labels=None):
- log_debug(2)
- channels = self._validate_channels(channel_labels=channel_labels)
-
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer, ChannelsDumperEx(writer,
- channels=channels.values()))
- dumper.dump()
- writer.flush()
- log_debug(4, "OK")
- self.close()
- return 0
-
- def dump_channel_packages_short(self, channel_label, last_modified):
- log_debug(2, channel_label)
- channels = self._validate_channels(channel_labels=[channel_label])
- channel_obj = channels[channel_label]
- db_last_modified = int(rhnLib.timestamp(channel_obj['last_modified']))
- last_modified = int(rhnLib.timestamp(last_modified))
- log_debug(3, "last modified", last_modified, "db last modified",
- db_last_modified)
- if last_modified != db_last_modified:
- raise rhnFault(3013, "The requested channel version does not match"
- " the upstream version", explain=0)
- channel_id = channel_obj['channel_id']
- key = "xml-channel-packages/rhn-channel-%d.data" % channel_id
- # Try to get everything off of the cache
- val = rhnCache.get(key, compressed=0, raw=1, modified=last_modified)
- if val is None:
- # Not generated yet
- log_debug(4, "Cache MISS for %s (%s)" % (channel_label,
- channel_id))
- stream = self._cache_channel_packages_short(channel_id, key,
- last_modified)
- else:
- log_debug(4, "Cache HIT for %s (%s)" % (channel_label,
- channel_id))
- temp_stream = tempfile.TemporaryFile()
- temp_stream.write(val)
- temp_stream.flush()
- stream = self._normalize_compressed_stream(temp_stream)
-
- # Copy the results to the output stream
- # They shold be already compressed if they were requested to be
- # compressed
- buffer_size = 16384
- # Send the HTTP headers - but don't init the compressed stream since
- # we send the data ourselves
- self._send_headers(init_compressed_stream=0)
- while 1:
- buff = stream.read(buffer_size)
- if not buff:
- break
- try:
- self._raw_stream.write(buff)
- except IOError:
- log_error("Client disconnected prematurely")
- self.close()
- raise ClosedConnectionError
- # We're done
- return 0
-
- def _packages(self, packages, prefix, dump_class, sources=0):
- if sources:
- h = self.get_source_packages_statement()
- else:
- h = self.get_packages_statement()
-
- packages_hash = {}
- for package in packages:
- package = str(package)
- if package[:len(prefix)] != prefix:
- raise rhnFault(3002, "Invalid package name %s" % package)
- package_id = package[len(prefix):]
- try:
- package_id = int(package_id)
- except ValueError:
- raise rhnFault(3002, "Invalid package name %s" % package)
- if packages_hash.has_key(package_id):
- # Already verified
- continue
- h.execute(package_id=package_id)
- row = h.fetchone_dict()
- if not row:
- # XXX Silently ignore it?
- raise rhnFault(3003, "No such package %s" % package)
- # Saving the row, it's handy later when we create the iterator
- packages_hash[package_id] = row
-
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- dump_class(writer, packages_hash.values()))
- dumper.dump()
- writer.flush()
- log_debug(4, "OK")
- self.close()
- return 0
-
- def dump_errata(self, errata):
- log_debug(2)
-
- h = self.get_errata_statement()
-
- errata_hash = {}
- prefix = 'rhn-erratum-'
- for erratum in errata:
- erratum = str(erratum)
- if erratum[:len(prefix)] != prefix:
- raise rhnFault(3004, "Wrong erratum name %s" % erratum)
- errata_id = erratum[len(prefix):]
- try:
- errata_id = int(errata_id)
- except ValueError:
- raise rhnFault(3004, "Wrong erratum name %s" % erratum)
- if errata_hash.has_key(errata_id):
- # Already verified
- continue
- h.execute(errata_id=errata_id)
- row = h.fetchone_dict()
- if not row:
- # XXX Silently ignore it?
- raise rhnFault(3005, "No such erratum %s" % erratum)
- # Saving the row, it's handy later when we create the iterator
- errata_hash[errata_id] = row
-
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- ErrataDumper(writer, errata_hash.values()))
- dumper.dump()
- writer.flush()
- log_debug(4, "OK")
- self.close()
- return 0
-
- def dump_kickstartable_trees(self, kickstart_labels=None):
- log_debug(2)
- kickstarts = self._validate_kickstarts(
- kickstart_labels=kickstart_labels)
-
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer,
- KickstartableTreesDumper(writer, kickstarts=kickstarts))
- dumper.dump()
- writer.flush()
- log_debug(4, "OK")
- self.close()
- return 0
-
- def dump_product_names(self):
- log_debug(4)
- writer = self._get_xml_writer()
- dumper = SatelliteDumper(writer, exportLib.ProductNamesDumper(writer))
- dumper.dump()
- writer.flush()
- self.close()
- return 0
+ pass
class SatelliteDumper(exportLib.SatelliteDumper):
def set_attributes(self):
commit 6fd98337fdef099a67fa9a32dd98d7fc5e5f3537
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 15:47:50 2010 +0200
moved _send_headers(), send() and close() to NonAuthenticatedDumper
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 34197c3..3177bb0 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -97,6 +97,64 @@ class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
"""
self._channel_family_query = None
+ def _send_headers(self, error=0, init_compressed_stream=1):
+ log_debug(4, "is_closed", self._is_closed)
+ if self._is_closed:
+ raise Exception, "Trying to write to a closed connection"
+ if self._headers_sent:
+ return
+ self._headers_sent = 1
+ if self.compress_level:
+ self.headers_out['Content-Encoding'] = 'gzip'
+ # Send the headers
+ if error:
+ # No compression
+ self.compress_level = 0
+ self._raw_stream.content_type = 'text/xml'
+ for h, v in self.headers_out.items():
+ self._raw_stream.headers_out[h] = str(v)
+ self._raw_stream.send_http_header()
+ # If need be, start gzipping
+ if self.compress_level and init_compressed_stream:
+ log_debug(4, "Compressing with factor %s" % self.compress_level)
+ self._compressed_stream = gzip.GzipFile(None, "wb",
+ self.compress_level, self._raw_stream)
+
+ def send(self, data):
+ log_debug(3, "Sending %d bytes" % len(data))
+ try:
+ self._send_headers()
+ if self._compressed_stream:
+ log_debug(4, "Sending through a compressed stream")
+ self._compressed_stream.write(data)
+ else:
+ self._raw_stream.write(data)
+ except IOError:
+ log_error("Client appears to have closed connection")
+ self.close()
+ raise dumper.ClosedConnectionError
+ log_debug(5, "Bytes sent", len(data))
+
+ write = send
+
+ def close(self):
+ log_debug(2, "Closing")
+ if self._is_closed:
+ log_debug(3, "Already closed")
+ return
+
+ if self._compressed_stream:
+ log_debug(5, "Closing a compressed stream")
+ try:
+ self._compressed_stream.close()
+ except IOError, e:
+ # Remote end has closed connection already
+ log_error("Error closing the stream", str(e))
+ pass
+ self._compressed_stream = None
+ self._is_closed = 1
+ log_debug(3, "Closed")
+
def set_channel_family_query(self, channel_labels=[]):
if not channel_labels:
# All null-pwned channel families
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index 57abde4..c081212 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -534,64 +534,6 @@ class XML_Dumper:
return result
class XML_DumperEx(XML_Dumper):
- def _send_headers(self, error=0, init_compressed_stream=1):
- log_debug(4, "is_closed", self._is_closed)
- if self._is_closed:
- raise Exception, "Trying to write to a closed connection"
- if self._headers_sent:
- return
- self._headers_sent = 1
- if self.compress_level:
- self.headers_out['Content-Encoding'] = 'gzip'
- # Send the headers
- if error:
- # No compression
- self.compress_level = 0
- self._raw_stream.content_type = 'text/xml'
- for h, v in self.headers_out.items():
- self._raw_stream.headers_out[h] = str(v)
- self._raw_stream.send_http_header()
- # If need be, start gzipping
- if self.compress_level and init_compressed_stream:
- log_debug(4, "Compressing with factor %s" % self.compress_level)
- self._compressed_stream = gzip.GzipFile(None, "wb",
- self.compress_level, self._raw_stream)
-
- def send(self, data):
- log_debug(3, "Sending %d bytes" % len(data))
- try:
- self._send_headers()
- if self._compressed_stream:
- log_debug(4, "Sending through a compressed stream")
- self._compressed_stream.write(data)
- else:
- self._raw_stream.write(data)
- except IOError:
- log_error("Client appears to have closed connection")
- self.close()
- raise ClosedConnectionError
- log_debug(5, "Bytes sent", len(data))
-
- write = send
-
- def close(self):
- log_debug(2, "Closing")
- if self._is_closed:
- log_debug(3, "Already closed")
- return
-
- if self._compressed_stream:
- log_debug(5, "Closing a compressed stream")
- try:
- self._compressed_stream.close()
- except IOError, e:
- # Remote end has closed connection already
- log_error("Error closing the stream", str(e))
- pass
- self._compressed_stream = None
- self._is_closed = 1
- log_debug(3, "Closed")
-
# Dumper functions here
def dump_channel_families(self, virt_filter=0):
log_debug(2)
commit d8bdbfb07fc386882d7dced778aea6a2ae446bec
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 15:36:15 2010 +0200
let's move XML_DumperEx methods to NonAuthenticatedDumper as it's the only subclass
and then remove XML_DumperEx completely
diff --git a/backend/satellite_exporter/handlers/non_auth_dumper.py b/backend/satellite_exporter/handlers/non_auth_dumper.py
index 9030af9..34197c3 100644
--- a/backend/satellite_exporter/handlers/non_auth_dumper.py
+++ b/backend/satellite_exporter/handlers/non_auth_dumper.py
@@ -41,7 +41,20 @@ class MissingPackageError(Exception):
class NonAuthenticatedDumper(rhnHandler, dumper.XML_DumperEx):
def __init__(self, req):
rhnHandler.__init__(self)
- dumper.XML_DumperEx.__init__(self, req)
+ self.compress_level = 5
+ self.headers_out = UserDictCase()
+ self._raw_stream = req
+ self._raw_stream.content_type = 'application/octet-stream'
+ # State machine
+ self._headers_sent = 0
+ self._is_closed = 0
+ self._compressed_stream = None
+ # Redefine in subclasses
+ self._channel_family_query = """
+ select pcf.channel_family_id, to_number(null) quantity
+ from rhnPublicChannelFamily pcf
+ """
+
# Don't check for abuse
self.check_for_abuse = 0
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index b8d9b16..57abde4 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -534,21 +534,6 @@ class XML_Dumper:
return result
class XML_DumperEx(XML_Dumper):
- def __init__(self, req):
- self.compress_level = 5
- self.headers_out = UserDictCase()
- self._raw_stream = req
- self._raw_stream.content_type = 'application/octet-stream'
- # State machine
- self._headers_sent = 0
- self._is_closed = 0
- self._compressed_stream = None
- # Redefine in subclasses
- self._channel_family_query = """
- select pcf.channel_family_id, to_number(null) quantity
- from rhnPublicChannelFamily pcf
- """
-
def _send_headers(self, error=0, init_compressed_stream=1):
log_debug(4, "is_closed", self._is_closed)
if self._is_closed:
commit 924fd71169227161d3d804c7261a399392ca0145
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 15:35:29 2010 +0200
601656 - fix channel permission check for errata.clone
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
index da694e3..1015da7 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java
@@ -42,11 +42,13 @@ import com.redhat.rhn.frontend.xmlrpc.InvalidPackageException;
import com.redhat.rhn.frontend.xmlrpc.MissingErrataAttributeException;
import com.redhat.rhn.frontend.xmlrpc.NoChannelsSelectedException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchChannelException;
+import com.redhat.rhn.frontend.xmlrpc.PermissionCheckFailureException;
import com.redhat.rhn.frontend.xmlrpc.packages.PackageHelper;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.errata.ErrataManager;
import com.redhat.rhn.manager.errata.cache.ErrataCacheManager;
import com.redhat.rhn.manager.rhnpackage.PackageManager;
+import com.redhat.rhn.manager.user.UserManager;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.lang.StringUtils;
@@ -869,13 +871,11 @@ public class ErrataHandler extends BaseHandler {
if (channel == null) {
throw new NoSuchChannelException();
}
- //do a user permission check
- if (!ChannelManager.verifyChannelAdmin(loggedInUser, channel.getId())) {
- throw new InvalidChannelRoleException(channel.getLabel());
+
+ if (!UserManager.verifyChannelAdmin(loggedInUser, channel)) {
+ throw new PermissionCheckFailureException();
}
- channel = ChannelFactory.lookupByIdAndUser(channel.getId(), loggedInUser);
-
List errataToClone = new ArrayList();
List toReturn = new ArrayList();
commit 878dcf859c4c87891c10537dea726305ea1d4b5d
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 14:39:18 2010 +0200
601656 - fix channel permission check for channel.software.mergePackages
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index bf6b001..f8072e2 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -20,7 +20,6 @@ import com.redhat.rhn.common.db.datasource.ModeFactory;
import com.redhat.rhn.common.db.datasource.SelectMode;
import com.redhat.rhn.common.db.datasource.WriteMode;
import com.redhat.rhn.common.hibernate.LookupException;
-import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.messaging.MessageQueue;
import com.redhat.rhn.common.security.PermissionException;
import com.redhat.rhn.domain.channel.Channel;
@@ -1904,17 +1903,11 @@ public class ChannelSoftwareHandler extends BaseHandler {
Channel mergeFrom = lookupChannelByLabel(loggedInUser, mergeFromLabel);
Channel mergeTo = lookupChannelByLabel(loggedInUser, mergeToLabel);
-
- try {
- ChannelManager.verifyChannelAdmin(loggedInUser, mergeTo.getId());
- }
- catch (InvalidChannelRoleException e) {
- LocalizationService ls = LocalizationService.getInstance();
- throw new PermissionException(ls.getMessage(
- "frontend.xmlrpc.channels.software.merge.permsfailure",
- mergeTo.getLabel()));
+
+ if (!UserManager.verifyChannelAdmin(loggedInUser, mergeTo)) {
+ throw new PermissionCheckFailureException();
}
-
+
List<Package> differentPackages = new ArrayList<Package>();
Set<Package> toPacks = mergeTo.getPackages();
commit 6cabba164fa96f091c042b2576cbf30911278080
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Jun 8 09:36:05 2010 -0400
fixing issue where package summary could be null, causing NPE
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java b/java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java
index 6c75756..32bd4dc 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java
@@ -14,6 +14,8 @@
*/
package com.redhat.rhn.frontend.dto;
+import org.apache.commons.lang.StringUtils;
+
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
@@ -108,7 +110,7 @@ public class PackageOverview extends BaseDto {
* @return Returns the summary.
*/
public String getSummary() {
- return summary.trim();
+ return StringUtils.defaultString(summary).trim();
}
/**
* @param summaryIn The summary to set.
commit af0a6d6fdd421e57146675d1a2bac2c19a92cfeb
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Jun 8 14:34:08 2010 +0200
589524 - select packages, erratas and kickstart trees according to import date
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index c82865b..b8d9b16 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -1051,8 +1051,12 @@ class _ChannelsDumper(exportLib._ChannelDumper):
from rhnPackage rp, rhnChannelPackage rcp
where rcp.channel_id = :channel_id
and rcp.package_id = rp.id
- and rp.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- and rp.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ and (rcp.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ or rp.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ )
+ and (rcp.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ and rp.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ )
""")
# Things that can be overwriten in subclasses
@@ -1074,8 +1078,12 @@ class _ChannelsDumper(exportLib._ChannelDumper):
from rhnChannelErrata ce, rhnErrata e
where ce.channel_id = :channel_id
and ce.errata_id = e.id
- and e.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
- and e.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ and (ce.modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ or e.last_modified >= TO_Date(:lower_limit, 'YYYYMMDDHH24MISS')
+ )
+ and (ce.modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ and e.last_modified <= TO_Date(:upper_limit, 'YYYYMMDDHH24MISS')
+ )
""")
def _get_errata_ids(self):
diff --git a/backend/satellite_tools/disk_dumper/iss.py b/backend/satellite_tools/disk_dumper/iss.py
index 3359358..c9e2b02 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -245,8 +245,12 @@ class Dumper(dumper.XML_Dumper):
"""
if self.start_date:
query += """
- and rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
- and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ )
+ and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ )
"""
self.brpm_query = rhnSQL.Statement(query)
brpm_data = rhnSQL.prepare(self.brpm_query)
@@ -276,8 +280,12 @@ class Dumper(dumper.XML_Dumper):
"""
if self.start_date:
query += """
- and rp.last_modified >= TO_DATE(:start_date,'YYYYMMDDHH24MISS')
- and rp.last_modified <= TO_DATE(:end_date,'YYYYMMDDHH24MISS')
+ and (rcp.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ or rp.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ )
+ and (rcp.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and rp.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ )
"""
self.package_query = rhnSQL.Statement(query)
package_data = rhnSQL.prepare(self.package_query)
@@ -311,8 +319,12 @@ class Dumper(dumper.XML_Dumper):
"""
if self.start_date:
query += """
- where ps.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
- and ps.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ where (ps.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ or ps.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ )
+ and (ps.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and ps.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ )
"""
self.source_package_query = rhnSQL.Statement(query)
source_package_data = rhnSQL.prepare(self.source_package_query)
@@ -343,8 +355,12 @@ class Dumper(dumper.XML_Dumper):
"""
if self.start_date:
query += """
- and e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
- and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and (ce.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ or e.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ )
+ and (ce.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and e.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ )
"""
self.errata_query = rhnSQL.Statement(query)
errata_data = rhnSQL.prepare(self.errata_query)
@@ -374,8 +390,12 @@ class Dumper(dumper.XML_Dumper):
"""
if self.start_date:
query += """
- and kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
- and kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and (kt.last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ or kt.modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
+ )
+ and (kt.last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ and kt.modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
+ )
and kt.org_id is Null
"""
self.kickstart_trees_query = rhnSQL.Statement(query)
commit 877a9e218e517e4b75e8c7e1d0cc22174244ce52
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 14:26:23 2010 +0200
601656 - fix channel permission check
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index b552262..bf6b001 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -1761,14 +1761,8 @@ public class ChannelSoftwareHandler extends BaseHandler {
Channel mergeFrom = lookupChannelByLabel(loggedInUser, mergeFromLabel);
Channel mergeTo = lookupChannelByLabel(loggedInUser, mergeToLabel);
- try {
- ChannelManager.verifyChannelAdmin(loggedInUser, mergeTo.getId());
- }
- catch (InvalidChannelRoleException e) {
- LocalizationService ls = LocalizationService.getInstance();
- throw new PermissionException(ls.getMessage(
- "frontend.xmlrpc.channels.software.merge.permsfailure",
- mergeTo.getLabel()));
+ if (!UserManager.verifyChannelAdmin(loggedInUser, mergeTo)) {
+ throw new PermissionCheckFailureException();
}
Set<Errata> mergedErrata =
@@ -1809,14 +1803,8 @@ public class ChannelSoftwareHandler extends BaseHandler {
Channel mergeFrom = lookupChannelByLabel(loggedInUser, mergeFromLabel);
Channel mergeTo = lookupChannelByLabel(loggedInUser, mergeToLabel);
- try {
- ChannelManager.verifyChannelAdmin(loggedInUser, mergeTo.getId());
- }
- catch (InvalidChannelRoleException e) {
- LocalizationService ls = LocalizationService.getInstance();
- throw new PermissionException(ls.getMessage(
- "frontend.xmlrpc.channels.software.merge.permsfailure",
- mergeTo.getLabel()));
+ if (!UserManager.verifyChannelAdmin(loggedInUser, mergeTo)) {
+ throw new PermissionCheckFailureException();
}
Set<Errata> toErrata = mergeTo.getErratas();
commit 5c14ba73da7e5f19bdc73092bbfa51f632cb536a
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 14:00:00 2010 +0200
591291 - clone errata instead of associating them to custom channels
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index b17d64e..b552262 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -30,6 +30,7 @@ import com.redhat.rhn.domain.channel.InvalidChannelRoleException;
import com.redhat.rhn.domain.channel.NewChannelHelper;
import com.redhat.rhn.domain.errata.Errata;
import com.redhat.rhn.domain.errata.ErrataFactory;
+import com.redhat.rhn.domain.errata.impl.PublishedClonedErrata;
import com.redhat.rhn.domain.org.Org;
import com.redhat.rhn.domain.rhnpackage.Package;
import com.redhat.rhn.domain.rhnpackage.PackageFactory;
@@ -57,6 +58,7 @@ import com.redhat.rhn.frontend.xmlrpc.user.XmlRpcUserHelper;
import com.redhat.rhn.manager.channel.ChannelEditor;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.channel.CreateChannelCommand;
+import com.redhat.rhn.manager.errata.ErrataManager;
import com.redhat.rhn.manager.errata.cache.ErrataCacheManager;
import com.redhat.rhn.manager.system.IncompatibleArchException;
import com.redhat.rhn.manager.system.SystemManager;
@@ -1769,13 +1771,10 @@ public class ChannelSoftwareHandler extends BaseHandler {
mergeTo.getLabel()));
}
- Set<Errata> toErrata = mergeTo.getErratas();
- Set<Errata> fromErrata = mergeFrom.getErratas();
- Set<Errata> differentErrata = errataDiff(fromErrata, toErrata);
+ Set<Errata> mergedErrata =
+ mergeErrataToChannel(loggedInUser, mergeFrom.getErratas(), mergeTo);
- mergeTo.getErratas().addAll(differentErrata);
- ChannelFactory.save(mergeTo);
- return differentErrata.toArray();
+ return mergedErrata.toArray();
}
/**
@@ -1823,30 +1822,60 @@ public class ChannelSoftwareHandler extends BaseHandler {
Set<Errata> toErrata = mergeTo.getErratas();
List<Errata> fromErrata = ErrataFactory.lookupByChannelBetweenDates(
loggedInUser.getOrg(), mergeFrom, startDate, endDate);
- Set<Errata> differentErrata = errataDiff(new HashSet(fromErrata), toErrata);
- mergeTo.getErratas().addAll(differentErrata);
- ChannelFactory.save(mergeTo);
- return differentErrata.toArray();
+ Set<Errata> mergedErrata =
+ mergeErrataToChannel(loggedInUser, mergeFrom.getErratas(), mergeTo);
+
+ return mergedErrata.toArray();
}
- private Set<Errata> errataDiff(Set<Errata> from, Set<Errata> to) {
- Set<Errata> diff = new HashSet<Errata>();
- for (Errata errata : from) {
- if (!errataInSet(to, errata)) {
- diff.add(errata);
+ private Set<Errata> mergeErrataToChannel(User user, Set<Errata> fromErrata,
+ Channel toChannel) {
+ Set<Errata> toErrata = toChannel.getErratas();
+ Set<Errata> diffErrata = new HashSet(fromErrata);
+
+ for (Iterator iter = fromErrata.iterator(); iter.hasNext();) {
+ Errata errata = (Errata) iter.next();
+ if (toErrata.contains(errata)) {
+ // remove errata already in channel
+ diffErrata.remove(errata);
+ }
+ else if (errata.isCloned()) {
+ Errata origErrata = ((PublishedClonedErrata) errata).getOriginal();
+ if (cloneInSet(user, origErrata, toErrata)) {
+ // remove errata those brothers already in channel
+ // (different clones of the same original)
+ diffErrata.remove(errata);
+ }
+ }
+ else {
+ if (cloneInSet(user, errata, toErrata)) {
+ // remove errata those clones already in channel
+ diffErrata.remove(errata);
+ }
}
}
- return diff;
+
+ ErrataManager.publishErrataToChannel(toChannel, getErrataIds(diffErrata), user);
+ ChannelFactory.save(toChannel);
+
+ return diffErrata;
}
- private boolean errataInSet(Set<Errata> where, Errata what) {
- for (Errata errata : where) {
- if (errata.equals(what)) {
- return true;
- }
+ private Set<Long> getErrataIds(Set<Errata> errata) {
+ Set<Long> ids = new HashSet();
+ for (Errata erratum : errata) {
+ ids.add(erratum.getId());
}
- return false;
+ return ids;
+ }
+
+ private Boolean cloneInSet(User user, Errata original, Set<Errata> set) {
+ List<Errata> clones = ErrataManager.lookupPublishedByOriginal(
+ user, original);
+ int numOfClones = clones.size();
+ clones.removeAll(set);
+ return (clones.size() != numOfClones);
}
/*
commit 7021edfc653b6d422e9863a033171a792e545fb2
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 09:56:35 2010 +0200
fixing hashCode for Errata
the bug prevented to work errata comparism, errata set operations, ...
diff --git a/java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java b/java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java
index b903f59..7d302d6 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java
+++ b/java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java
@@ -649,6 +649,6 @@ public abstract class AbstractErrata extends BaseDomainHelper implements
eb.append(this.getAdvisoryRel());
eb.append(this.getAdvisorySynopsis());
eb.append(this.getOrg());
- return eb.hashCode();
+ return eb.toHashCode();
}
}
commit 18f23c924e962b7e3a640d49fea8b1ecdc0f1876
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 8 13:25:35 2010 +0200
596237 - use constants in SendingWindow
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index b21b284..313dece 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -129,6 +129,9 @@ SEND_WINDOW_DESC = _("We are finished collecting information for the System Prof
"You can run the registration program later by "
"typing `rhn_register` at the command line.")
+# Sending Window
+SENDING_WINDOW = _("Sending Profile to Red Hat Network")
+
# Finish Window
FINISH_WINDOW = _("Finish setting up software updates")
FINISH_WINDOW_TEXT_TUI = _("You may now run 'yum update' from this system's "
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 5e208e1..cb64223 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -793,8 +793,7 @@ class SendingWindow:
self.name = "SendingWindow"
size = snack._snack.size()
- self.pwin = snack.GridForm(screen, _("Sending Profile to Red Hat Network"),
- 1, 1)
+ self.pwin = snack.GridForm(screen, SENDING_WINDOW, 1, 1)
self.scale = snack.Scale(40, 100)
self.pwin.add(self.scale, 0, 0)
commit abd6b45fd407b3ada03bc440d92f76342c58632e
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 8 13:22:35 2010 +0200
596237 - use constants in SendWindow
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index c32996b..b21b284 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -122,11 +122,12 @@ SYSTEM_ALREADY_REGISTERED = _("It appears this system has already been set up fo
SYSTEM_ALREADY_REGISTERED_CONT = _("Are you sure you would like to continue?")
# Send Window
-SEND_WINDOW = _("We are finished collecting information for the System Profile.\n\n"
- "Press \"Next\" to send this System Profile to Red Hat Network. "
- "Click \"Cancel\" and no information will be sent. "
- "You can run the registration program later by "
- "typing `rhn_register` at the command line.")
+SEND_WINDOW = _("Send Profile Information to Red Hat Network")
+SEND_WINDOW_DESC = _("We are finished collecting information for the System Profile.\n\n"
+ "Press \"Next\" to send this System Profile to Red Hat Network. "
+ "Click \"Cancel\" and no information will be sent. "
+ "You can run the registration program later by "
+ "typing `rhn_register` at the command line.")
# Finish Window
FINISH_WINDOW = _("Finish setting up software updates")
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 096256e..5e208e1 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -757,10 +757,9 @@ class SendWindow:
self.name = "SendWindow"
size = snack._snack.size()
- toplevel = snack.GridForm(screen, _("Send Profile Information to Red Hat Network"),
- 1, 2)
+ toplevel = snack.GridForm(screen, SEND_WINDOW, 1, 2)
- text = snack.TextboxReflowed(size[0]-15, SEND_WINDOW)
+ text = snack.TextboxReflowed(size[0]-15, SEND_WINDOW_DESC)
toplevel.add(text, 0, 0)
# BUTTON BAR
commit 10ac58f27079f27b289be6be0d598029152f3508
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 8 13:19:18 2010 +0200
596237 - use constants in PackagesWindow
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index 8fb8b7e..c32996b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -99,6 +99,17 @@ HARDWARE_WINDOW_DESC2 = _("Additional hardware information including PCI"
HARDWARE_WINDOW_CHECKBOX = _("Include the following information about hardware"
" and network:")
+# Packages Window
+PACKAGES_WINDOW = _("Register a System Profile - Packages")
+PACKAGES_WINDOW_DESC1 = _("RPM information is important to determine what"
+ " updated software packages are relevant to this"
+ " system.")
+PACKAGES_WINDOW_DESC2 = _("Include RPM packages installed on this system"
+ " in my System Profile")
+PACKAGES_WINDOW_UNCHECK = _("You may deselect individual packages by"
+ " unchecking them below.")
+PACKAGES_WINDOW_PKGLIST = _("Building Package List")
+
# Product Window
HOSTED_LOGIN_PROMPT = _("Please enter your login information for Red "
"Hat Network (http://rhn.redhat.com/):\n\n")
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 a0d33e9..096256e 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -676,20 +676,19 @@ class PackagesWindow:
self.screen = screen
self.tui = tui
size = snack._snack.size()
- toplevel = snack.GridForm(screen, _("Register a System Profile - Packages"),
- 1, 5)
+ toplevel = snack.GridForm(screen, PACKAGES_WINDOW, 1, 5)
self.g = toplevel
- text = snack.TextboxReflowed(size[0]-10, _("RPM information is important to determine what updated software packages are relevant to this system."))
+ text = snack.TextboxReflowed(size[0]-10, PACKAGES_WINDOW_DESC1)
toplevel.add(text, 0, 0, anchorLeft = 1)
- self.packagesButton = snack.Checkbox(_("Include RPM packages installed on this system in my System Profile"), 1)
+ self.packagesButton = snack.Checkbox(PACKAGES_WINDOW_DESC2, 1)
toplevel.add(self.packagesButton, 0, 1, padding = (0, 1, 0, 1),
anchorLeft = 1)
- label = snack.Label(_("You may deselect individual packages by unchecking them below."))
+ label = snack.Label(PACKAGES_WINDOW_UNCHECK)
toplevel.add(label, 0, 2, anchorLeft = 1)
#self.packageList = snack.Listbox(size[1]-18, 1, width = size[0]-10)
@@ -698,8 +697,7 @@ class PackagesWindow:
# do we need to read the packages from disk?
if tui.packageList == []:
- self.pwin = snack.GridForm(screen, _("Building Package List"),
- 1, 1)
+ self.pwin = snack.GridForm(screen, PACKAGES_WINDOW_PKGLIST, 1, 1)
self.scale = snack.Scale(40, 100)
self.pwin.add(self.scale, 0, 0)
commit 790678be341a0d43b69a10a7dbf85b98a91ec18b
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 8 13:10:34 2010 +0200
596237 - use constants in HardwareWindow
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index aca761d..8fb8b7e 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -87,6 +87,18 @@ CONFIRM_OS_ALL = _("Your system will be subscribed to the base"
" software channel to receive all available"
" updates.")
+# Hardware Window
+HARDWARE_WINDOW = _("Register a System Profile - Hardware")
+HARDWARE_WINDOW_DESC1 = _("A Profile Name is a descriptive name that"
+ " you choose to identify this System Profile"
+ " on the Red Hat Network web pages. Optionally,"
+ " include a computer serial or identification number.")
+HARDWARE_WINDOW_DESC2 = _("Additional hardware information including PCI"
+ " devices, disk sizes and mount points will be"
+ " included in the profile.")
+HARDWARE_WINDOW_CHECKBOX = _("Include the following information about hardware"
+ " and network:")
+
# Product Window
HOSTED_LOGIN_PROMPT = _("Please enter your login information for Red "
"Hat Network (http://rhn.redhat.com/):\n\n")
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 c34e313..a0d33e9 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -564,10 +564,9 @@ class HardwareWindow:
# read all hardware in
tui.hardware = hardware.Hardware()
- toplevel = snack.GridForm(screen, _("Register a System Profile - Hardware"),
- 1, 7)
+ toplevel = snack.GridForm(screen, HARDWARE_WINDOW, 1, 7)
- text = snack.TextboxReflowed(70, _("A Profile Name is a descriptive name that you choose to identify this System Profile on the Red Hat Network web pages. Optionally, include a computer serial or identification number."))
+ text = snack.TextboxReflowed(70, HARDWARE_WINDOW_DESCRIPTION)
toplevel.add(text, 0, 0, anchorLeft = 1)
@@ -582,9 +581,9 @@ class HardwareWindow:
toplevel.add(grid, 0, 1, anchorLeft = 1)
if tui.includeHardware:
- self.hardwareButton = snack.Checkbox(_("Include the following information about hardware and network:"), isOn = 1)
+ self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX, isOn = 1)
else:
- self.hardwareButton = snack.Checkbox(_("Include the following information about hardware and network:"))
+ self.hardwareButton = snack.Checkbox(HARDWARE_WINDOW_CHECKBOX)
toplevel.add(self.hardwareButton, 0, 2, padding = (0, 1, 0, 0),
anchorLeft = 1)
@@ -640,7 +639,7 @@ class HardwareWindow:
tb = snack.TextboxReflowed(80, hardware_text)
toplevel.add(tb, 0, 4)
- self.additionalHWLabel = snack.TextboxReflowed(size[0]-10, _("Additional hardware information including PCI devices, disk sizes and mount points will be included in the profile."))
+ self.additionalHWLabel = snack.TextboxReflowed(size[0]-10, HARDWARE_WINDOW_DESC2)
toplevel.add(self.additionalHWLabel, 0, 5, padding = (0, 1, 0, 0),
anchorLeft = 1)
commit a7e6566dfb5a723b56ee0b6229451a33f28fee41
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 8 12:59:04 2010 +0200
596237 - use constants in OSReleaseWindow & AlreadyRegisteredWindow
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
index 2edde34..aca761d 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py
@@ -76,6 +76,17 @@ LOGIN_TIP = _("Tip: Forgot your login or password? Contact your "
USER_REQUIRED = _("Please enter a desired login.")
PASSWORD_REQUIRED = _("Please enter and verify a password.")
+# OS Release Window
+SELECT_OSRELEASE = _("Select Operating System Release")
+OS_VERSION = _("Operating System version:")
+MINOR_RELEASE = _(" Minor Release: ")
+LIMITED_UPDATES = _("Limited Updates Only")
+ALL_UPDATES = _("All available updates")
+CONFIRM_OS_RELEASE_SELECTION = _("Confirm operating system release selection")
+CONFIRM_OS_ALL = _("Your system will be subscribed to the base"
+ " software channel to receive all available"
+ " updates.")
+
# Product Window
HOSTED_LOGIN_PROMPT = _("Please enter your login information for Red "
"Hat Network (http://rhn.redhat.com/):\n\n")
@@ -83,6 +94,7 @@ HOSTED_LOGIN_TIP = _("Tip: Forgot your login or password? "
"Visit: https://rhn.redhat.com/rhn/sales/LoginInfo.do")
EMAIL = _("*Email Address:")
+SYSTEM_ALREADY_SETUP = _("System software updates already set up")
SYSTEM_ALREADY_REGISTERED = _("It appears this system has already been set up for software updates:")
SYSTEM_ALREADY_REGISTERED_CONT = _("Are you sure you would like to continue?")
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 618cf52..c34e313 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -109,7 +109,7 @@ class AlreadyRegisteredWindow:
oldUsername = systemIdXml[0][0]['username']
oldsystemId = systemIdXml[0][0]['system_id']
- toplevel = snack.GridForm(self.screen, _("System software updates already set up"), 1, 2)
+ toplevel = snack.GridForm(self.screen, SYSTEM_ALREADY_SETUP, 1, 2)
self.bb = snack.ButtonBar(self.screen,
[(YES_CONT, "next"),
(NO_CANCEL, "exit")])
@@ -430,14 +430,12 @@ class OSReleaseWindow:
self.selectChannel = False
- toplevel = snack.GridForm(self.screen,
- _("Select Operating System Release"), 1, 7)
+ toplevel = snack.GridForm(self.screen, SELECT_OSRELEASE, 1, 7)
self.g = toplevel
- self.ostext = snack.TextboxReflowed(self.size[0]-10,
- _("Operating System version:"))
+ self.ostext = snack.TextboxReflowed(self.size[0]-10, OS_VERSION)
toplevel.add(self.ostext, 0, 0, anchorLeft = 1)
- optiontext1 = _("Limited Updates Only")
+ optiontext1 = LIMITED_UPDATES
if self.tui.limited_updates_button:
self.limited_updates_button = snack.SingleRadioButton(optiontext1,
@@ -449,7 +447,7 @@ class OSReleaseWindow:
toplevel.add(self.limited_updates_button, 0, 1, padding = (0, 1, 0, 1),
anchorLeft = 1)
- self.sublabel = snack.Label(_(" Minor Release: "))
+ self.sublabel = snack.Label(MINOR_RELEASE)
toplevel.add(self.sublabel, 0, 2, anchorLeft = 1)
self.channelList = snack.Listbox(self.size[1]-22, 1,
@@ -464,7 +462,7 @@ class OSReleaseWindow:
self.tip = snack.TextboxReflowed(self.size[0]-10, CHANNEL_PAGE_TIP)
toplevel.add(self.tip, 0, 4, anchorLeft = 1)
- optiontext2 = _("All available updates")
+ optiontext2 = ALL_UPDATES
if self.tui.all_updates_button:
self.all_updates_button = snack.SingleRadioButton(optiontext2,
@@ -517,7 +515,7 @@ class OSReleaseWindow:
later_release = self.channelList.current() != \
self.available_channels['default_channel']
- title = _("Confirm operating system release selection")
+ title = CONFIRM_OS_RELEASE_SELECTION
if later_release:
msgbox = snack.ButtonChoiceWindow(self.screen, title,
CONFIRM_OS_WARNING % self.channelList.current(),
@@ -525,9 +523,6 @@ class OSReleaseWindow:
return msgbox
if self.all_updates_button.selected() or later_release:
- CONFIRM_OS_ALL = _("Your system will be subscribed to the base"
- " software channel to receive all available"
- " updates.")
msgbox = snack.ButtonChoiceWindow(self.screen, title,
CONFIRM_OS_ALL, buttons =[OK, CANCEL])
return msgbox
commit de81e657281610d344bda399011b69dd1cecd2cd
Author: ypoyarko <ypoyarko(a)fedoraproject.org>
Date: Tue Jun 8 05:09:50 2010 +0000
l10n: Updates to Russian (ru) translation
Transmitted-via: Transifex (translate.fedoraproject.org)
diff --git a/client/rhel/rhn-client-tools/po/ru.po b/client/rhel/rhn-client-tools/po/ru.po
index d917c56..5ed88f1 100644
--- a/client/rhel/rhn-client-tools/po/ru.po
+++ b/client/rhel/rhn-client-tools/po/ru.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: ru\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-05-07 13:34+0200\n"
-"PO-Revision-Date: 2010-06-07 13:36\n"
+"PO-Revision-Date: 2010-06-08 15:05\n"
"Last-Translator: Yulia <ypoyarko(a)redhat.com>\n"
"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
@@ -722,14 +722,14 @@ msgstr ""
#: ../src/up2date_client/rhnreg_constants.py:221
#, python-format
msgid "Architecture: %s, OS Release: %s, OS Version: %s"
-msgstr "Архитектура: %s, Выпуск ОС: %s, Версия ОС: %s"
+msgstr "Архитектура: %s, выпуск ОС: %s, версия ОС: %s"
#: ../src/up2date_client/rhnreg_constants.py:223
msgid ""
"This server doesn't support functionality needed by this version of the "
"software update setup client. Please try again with a newer server."
msgstr ""
-"Сервер не поддерживает функциональность, необходимую для данной версией "
+"Сервер не поддерживает функциональность, необходимую для данной версии "
"клиента настройки обновлений ПО. Повторите попытку с более поздней версией "
"сервера."
@@ -780,13 +780,13 @@ msgid ""
"universal default activation key. More details can be found in Red Hat "
"Knowledgebase Article #7924 at http://kbase.redhat.com/faq/FAQ_61_7924.shtm "
msgstr ""
-"Проблема с регистрацией системы:\n"
+"Проблема при регистрации системы:\n"
"\n"
"Универсальный ключ активации ограничивает число систем, подключаемых к "
-"организации RHN, связанной с вашей учетной записью. Для разрешения "
-"подключения данной системы обратитесь к вашему Администратору организации "
-"RHN и запросите либо увеличение числа систем, которым разрешено подключение, "
-"либо деактивацию универсального ключа. Более подробная информация может быть "
+"организации RHN, связанной с вашей учётной записью. Для разрешения "
+"подключения данной системы обратитесь к вашему администратору организации "
+"RHN и запросите увеличение числа систем, которым разрешено подключение, "
+"или деактивацию универсального ключа. Более подробная информация может быть "
"найдена в статье #7924 Базы знаний по адресу http://kbase.redhat.com/faq/"
"FAQ_61_7924.shtm (на английском)."
@@ -796,12 +796,15 @@ msgid ""
" Tip: Minor releases with a '*' are currently supported by Red Hat.\n"
"\n"
msgstr ""
+"\n"
+" Подсказка: в настоящее время вспомогательные выпуски с «*» поддерживаются Red Hat.\n"
+"\n"
#: ../src/up2date_client/rhnreg_constants.py:260
msgid ""
"Warning:You will not be able to limit this system to minor release that is "
"older than the recent minor release if you select this option.\n"
-msgstr ""
+msgstr "Предупреждение: при выборе этой опции вы не сможете ограничить систему вспомогательным выпуском, версия которого старше версии последнего выпуска.\n"
#: ../src/up2date_client/rhnreg_constants.py:265
#, python-format
@@ -816,7 +819,7 @@ msgstr ""
"основной программный канал %s.\n"
"Вы не сможете переназначить систему\n"
"предыдущему выпуску\n"
-"(но можно будет переназначить более\n"
+"(но можно переназначить более\n"
"позднему выпуску).\n"
"Вы действительно хотите продолжить?"
@@ -853,7 +856,7 @@ msgstr "Да, продолжить"
#: ../src/up2date_client/rhnreg_constants.py:281
msgid "Press <space> to deselect the option."
-msgstr "Нажмите <пробел> для отмены выделения."
+msgstr "Нажмите <пробел> для отмены выбора."
#: ../src/up2date_client/rhnregGui.py:113
msgid "Automatic Subscription Activation"
@@ -865,7 +868,7 @@ msgstr "Активация подписки"
#: ../src/up2date_client/rhnregGui.py:136
msgid "Notice"
-msgstr "Замечание"
+msgstr "Примечание"
#: ../src/up2date_client/rhnregGui.py:261
msgid "There was an error while applying your choice."
@@ -873,7 +876,7 @@ msgstr "Ошибка при применении изменений."
#: ../src/up2date_client/rhnregGui.py:287
msgid "You specified an invalid protocol. Only https and http are allowed."
-msgstr "Указан неверный протокол. Только https и http могут быть заданы."
+msgstr "Указан неверный протокол. Допускаются только https и http."
#: ../src/up2date_client/rhnregGui.py:300
msgid ""
@@ -884,7 +887,7 @@ msgstr "Вы не сможете зарегистрировать систему
#: ../src/up2date_client/rhnregGui.py:325
#, python-format
msgid "We could not contact Red Hat Network (%s)."
-msgstr "Невозможно связаться с Red Hat Network (%s)."
+msgstr "Не удалось связаться с Red Hat Network (%s)."
#: ../src/up2date_client/rhnregGui.py:327
#: ../src/up2date_client/rhnregGui.py:340
@@ -896,13 +899,13 @@ msgid ""
"Did you mean to register to a Red Hat Network Satellite or Proxy? If so, you "
"can enter a Satellite or Proxy location instead."
msgstr ""
-"Если вы хотите зарегистрировать Red Hat Network Satellite или Proxy, введите "
-"положение соответствующего сервера."
+"Если вы хотите зарегистрироваться на Red Hat Network Satellite или Proxy, укажите "
+"расположение соответствующего сервера."
#: ../src/up2date_client/rhnregGui.py:335
#, python-format
msgid "We could not contact the Satellite or Proxy at '%s.'"
-msgstr "Невозможно связаться с Satellite или Proxy на '%s.'"
+msgstr "Не удалось связаться с Satellite или Proxy на «%s.»"
#: ../src/up2date_client/rhnregGui.py:337
#, python-format
@@ -910,7 +913,7 @@ msgid ""
"Double-check the location - is '%s' correct? If not, you can correct it and "
"try again."
msgstr ""
-"Проверьте правильность введенного пути - '%s'. Если неверно, исправьте и "
+"Проверьте правильность введённого пути («%s»). Если нужно, исправьте и "
"повторите попытку."
#: ../src/up2date_client/rhnregGui.py:350
@@ -919,18 +922,18 @@ msgstr "Ошибка при соединении с Red Hat Network."
#: ../src/up2date_client/rhnregGui.py:351
msgid "The server may be in outage mode. You may have to try connecting later."
-msgstr "Возможно, сервер в офлайн. Попробуйте подключиться позже."
+msgstr "Возможно, сервер отключен. Попробуйте подключиться позже."
#: ../src/up2date_client/rhnregGui.py:353
msgid "You may be running a client that is incompatible with the server."
-msgstr "Возможно ваш клиент несовместим с сервером."
+msgstr "Возможно, клиент несовместим с сервером."
#: ../src/up2date_client/rhnregGui.py:396
#, python-format
msgid ""
"Please enter your account information for the <b>%s</b> Red Hat Network "
"Satellite:"
-msgstr "Введите данные вашей учётной записи для <b>%s</b> Red Hat Network Satellite:"
+msgstr "Введите данные учётной записи для <b>%s</b> Red Hat Network Satellite:"
#: ../src/up2date_client/rhnregGui.py:445
msgid "You must enter a login."
@@ -942,13 +945,13 @@ msgstr "Необходимо ввести пароль."
#: ../src/up2date_client/rhnregGui.py:465
msgid "There was an error while logging in."
-msgstr "Ошибка при авторизации."
+msgstr "Ошибка авторизации."
#: ../src/up2date_client/rhnregGui.py:489
msgid ""
"There was an error communicating with the registration server. The message "
"was:\n"
-msgstr "Произошла ошибка связи с сервером регистрации. Сообщение:\n"
+msgstr "Ошибка связи с сервером регистрации. Сообщение:\n"
#: ../src/up2date_client/rhnregGui.py:631
msgid "There was an error while assembling information for the profile."
@@ -964,7 +967,7 @@ msgstr "Ошибка при заполнении профиля."
#: ../src/up2date_client/rhnregGui.py:699
msgid "You must choose a name for this profile."
-msgstr "Необходимо задать имя для данного профиля."
+msgstr "Необходимо задать имя профиля."
#: ../src/up2date_client/rhnregGui.py:714
msgid "There was an error while creating the profile."
@@ -973,19 +976,19 @@ msgstr "Ошибка при создании профиля."
#: ../src/up2date_client/rhnregGui.py:725
msgid "Sending your profile information to Red Hat Network. Please wait."
msgstr ""
-"Информация вашего профиля передается в Red Hat Network. Пожалуйста "
+"Информация профиля передаётся в Red Hat Network. Пожалуйста, "
"подождите."
#: ../src/up2date_client/rhnregGui.py:744
msgid "Registering System"
-msgstr "Система регистрируется"
+msgstr "Выполняется регистрация системы"
#: ../src/up2date_client/rhnregGui.py:758
#: ../src/up2date_client/rhnregGui.py:762
#: ../src/up2date_client/rhnregGui.py:766 ../src/up2date_client/tui.py:835
#: ../src/up2date_client/tui.py:838 ../src/up2date_client/tui.py:841
msgid "Problem registering system:\n"
-msgstr "Проблема с регистрацией системы:\n"
+msgstr "Проблема при регистрации системы:\n"
#: ../src/up2date_client/rhnregGui.py:769
#, python-format
@@ -993,20 +996,20 @@ msgid ""
"The installation number [ %s ] provided is not a valid installation number. "
"Please go back to the previous screen and fix it."
msgstr ""
-"Указанный номер установки [ %s ] не является корректным. Вернитесь к "
-"предыдущему экрану и исправьте номер."
+"Некорректный код установки: [ %s ]. Вернитесь к "
+"предыдущему экрану и исправьте код."
#: ../src/up2date_client/rhnregGui.py:779 ../src/up2date_client/tui.py:847
msgid "Problem registering system."
-msgstr "Проблема с регистрацией системы."
+msgstr "Проблема при регистрации системы."
#: ../src/up2date_client/rhnregGui.py:789 ../src/up2date_client/tui.py:852
msgid "Problem writing out system id to disk."
-msgstr "Проблема с записью системного идентификатора на диск."
+msgstr "Проблема при записи системного идентификатора на диск."
#: ../src/up2date_client/rhnregGui.py:795
msgid "There was a problem registering this system."
-msgstr "Проблема с регистрацией данной системы."
+msgstr "Проблема при регистрации данной системы."
#: ../src/up2date_client/rhnregGui.py:808
msgid "Sending hardware information"
@@ -1037,13 +1040,13 @@ msgstr "Ошибка при отправке информации о пакет
#: ../src/up2date_client/rhnregGui.py:893 ../src/up2date_client/tui.py:866
#: ../src/up2date_client/tui.py:880
msgid "Problem registering personal information:\n"
-msgstr "Проблема с регистрацией персональной информации:\n"
+msgstr "Проблема при регистрации личных данных:\n"
#: ../src/up2date_client/rhnregGui.py:881
#: ../src/up2date_client/rhnregGui.py:898 ../src/up2date_client/tui.py:872
#: ../src/up2date_client/tui.py:884
msgid "Problem registering personal information"
-msgstr "Проблема с регистрацией персональной информации"
+msgstr "Проблема при регистрации личных данных."
#: ../src/up2date_client/rhnregGui.py:940
msgid "There was an error while installing the certificate."
@@ -1060,7 +1063,7 @@ msgid ""
"There was an SSL error. This could be because the file you picked was not a "
"certificate file."
msgstr ""
-"Ошибка SSL. Возможная причина - выбранный файл не является файлом "
+"Ошибка SSL. Возможно, выбранный файл не является файлом "
"сертификата."
#. TODO Provide better messages
@@ -1086,7 +1089,7 @@ msgstr "%d МГц"
#: ../src/up2date_client/rhnregGui.py:1154
#, python-format
msgid "%s MB"
-msgstr "%s Мб"
+msgstr "%s МБ"
#: ../src/up2date_client/rhnregGui.py:1198
msgid "There was an error building the list of packages."
@@ -1103,7 +1106,7 @@ msgstr "Архитектура"
#: ../src/up2date_client/rhnregGui.py:1225
msgid "Building a list of RPM packages installed on your system. Please wait."
msgstr ""
-"Построение списка установленных в вашей системе RPM пакетов. Пожалуйста "
+"Создание списка установленных в вашей системе RPM пакетов. Пожалуйста, "
"подождите."
#: ../src/up2date_client/rhnregGui.py:1256
@@ -1120,8 +1123,8 @@ msgid ""
"There was an error saving your configuration. Make sure that\n"
"you own %s."
msgstr ""
-"Произошла ошибка сохранения вашей конфигурации. Убедитесь,\n"
-"что Вы имеете права записи в %s."
+"Произошла ошибка сохранения конфигурации. Убедитесь,\n"
+"что вы являетесь владельцем %s."
#: ../src/up2date_client/rhnregGui.py:1327
#, python-format
@@ -1130,13 +1133,13 @@ msgid ""
"program, please file a bug at bugzilla.redhat.com. Including the relevant "
"parts of '%s' would be very helpful. Thanks!"
msgstr ""
-"Непредвиденная ошибка. Если вы хотите помочь нам улучшить эту программу, "
-"отправьте отчет об ошибке через bugzilla.redhat.com. Если возможно, включите "
-"соответствующие сегменты '%s'. Спасибо!"
+"Непредвиденная ошибка. Чтобы помочь нам улучшить эту программу, "
+"отправьте отчёт об ошибке через bugzilla.redhat.com. Если возможно, включите "
+"соответствующие сегменты «%s». Спасибо!"
#: ../src/up2date_client/rhnreg.py:55
msgid "Warning: unable to enable rhnsd with chkconfig"
-msgstr "Внимание: Невозможно включить rhnsd с chkconfig"
+msgstr "Внимание: невозможно включить rhnsd с chkconfig"
#: ../src/up2date_client/rhnreg.py:65
msgid "Warning: unable to run rhn_check"
@@ -1148,7 +1151,7 @@ msgstr "Ошибка: сервер недоступен. Повторите по
#: ../src/up2date_client/rpcServer.py:171
msgid "ERROR: can not find RHNS CA file"
-msgstr "ОШИБКА: невозможно найти файл RHNS CA"
+msgstr "ОШИБКА: файл RHNS CA не найден"
#: ../src/up2date_client/rpcServer.py:207
msgid "Connection aborted by the user"
@@ -1164,7 +1167,7 @@ msgstr "Получение списка установленных в систе
#: ../src/up2date_client/tui.py:112 ../data/rh_register.glade.h:83
msgid "System software updates already set up"
-msgstr "Обновления ПО системы уже настроены"
+msgstr "Программные обновления системы уже настроены"
#: ../src/up2date_client/tui.py:115
msgid "Red Hat Network Location:"
@@ -1214,7 +1217,7 @@ msgstr "Ваша система будет подписана на основн
#: ../src/up2date_client/tui.py:572
msgid "Register a System Profile - Hardware"
-msgstr "Регистрация системного профиля: Оборудование"
+msgstr "Регистрация системного профиля: оборудование"
#: ../src/up2date_client/tui.py:575
msgid ""
@@ -1222,8 +1225,8 @@ msgid ""
"Profile on the Red Hat Network web pages. Optionally, include a computer "
"serial or identification number."
msgstr ""
-"Название профиля - это описательное имя, которое вы выбираете для "
-"идентификации этой системы на web-страницах Red Hat Network. Дополнительно, "
+"Название профиля — это описательное имя для "
+"идентификации системы на веб-страницах Red Hat Network. Дополнительно "
"включает серийный или идентификационный номер компьютера."
#: ../src/up2date_client/tui.py:581
@@ -1232,7 +1235,7 @@ msgstr "Название профиля:"
#: ../src/up2date_client/tui.py:590 ../src/up2date_client/tui.py:592
msgid "Include the following information about hardware and network:"
-msgstr "Включить следующую информацию об оборудовании и сети:"
+msgstr "Включите следующую информацию об оборудовании и сети:"
#: ../src/up2date_client/tui.py:603 ../src/up2date_client/tui.py:604
msgid "Version: "
@@ -1252,7 +1255,7 @@ msgstr "Скорость CPU: "
#: ../src/up2date_client/tui.py:633
msgid "IP Address: "
-msgstr "IP адрес: "
+msgstr "IP-адрес: "
#: ../src/up2date_client/tui.py:639
msgid "Memory: "
@@ -1268,28 +1271,28 @@ msgid ""
"Additional hardware information including PCI devices, disk sizes and mount "
"points will be included in the profile."
msgstr ""
-"Дополнительная информация об оборудовании, такая как устройства PCI, объем "
-"дисков и точки монтирования,будет включена в профиль."
+"Дополнительная информация об оборудовании, включая устройства PCI, объём "
+"дисков и точки подключения, будет добавлена в профиль."
#: ../src/up2date_client/tui.py:685
msgid "Register a System Profile - Packages"
-msgstr "Регистрация системного профиля: Пакеты"
+msgstr "Регистрация системного профиля: пакеты"
#: ../src/up2date_client/tui.py:690
msgid ""
"RPM information is important to determine what updated software packages are "
"relevant to this system."
msgstr ""
-"Информация о RPM является важной для определения того, какие из обновленных "
-"пакетов являются необходимыми для этой системы."
+"Информация о RPM необходима для определения того, какие из обновленных "
+"пакетов подходят этой системе."
#: ../src/up2date_client/tui.py:694
msgid "Include RPM packages installed on this system in my System Profile"
-msgstr "Включить пакеты, установленные в этой системе в мой системный профиль"
+msgstr "Включить установленные в системе пакеты в мой системный профиль"
#: ../src/up2date_client/tui.py:698
msgid "You may deselect individual packages by unchecking them below."
-msgstr "Вы можете исключить отдельные пакеты, сняв с них отметку ниже."
+msgstr "Вы можете исключить отдельные пакеты, отменив их выбор."
#: ../src/up2date_client/tui.py:707
msgid "Building Package List"
@@ -1339,15 +1342,15 @@ msgstr "Программу регистрации RHN необходимо за
#: ../src/up2date_client/up2dateErrors.py:31
msgid "Disk error. The message was:\n"
-msgstr "Ошибка диска. Сообщение:\n"
+msgstr "Ошибка диска. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:39
msgid "RPM error. The message was:\n"
-msgstr "Ошибка RPM. Сообщение:\n"
+msgstr "Ошибка RPM. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:50
msgid "There was a fatal error installing the package:\n"
-msgstr "Произошла фатальная ошибка установки пакета:\n"
+msgstr "Критическая ошибка при установке пакета:\n"
#: ../src/up2date_client/up2dateErrors.py:63
msgid "Password error. The message was:\n"
@@ -1355,7 +1358,7 @@ msgstr "Ошибка пароля. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:74
msgid "RPM package conflict error. The message was:\n"
-msgstr "Ошибка конфликта RPM пакета. Сообщение:\n"
+msgstr "Конфликт RPM-пакета. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:86
msgid "RPM file conflict error. The message was:\n"
@@ -1372,7 +1375,7 @@ msgstr "Ошибка RPM. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:127
#: ../src/up2date_client/up2dateErrors.py:140
msgid "RPM dependency error. The message was:\n"
-msgstr "Зависимость RPM нарушена. Сообщение:\n"
+msgstr "Ошибка зависимостей RPM. Сообщение:\n"
#: ../src/up2date_client/up2dateErrors.py:151
msgid "Package Skip List error. The message was:\n"
@@ -1399,7 +1402,7 @@ msgstr "Ошибка задержки от сервера. Сообщение:\n
#: ../src/up2date_client/up2dateErrors.py:204
#, python-format
msgid "Could not remove package \"%s\". It was on the RemoveSkipList"
-msgstr "Не могу удалить пакет \"%s\". Он был в составе RemoveSkipList"
+msgstr "Не удалось удалить пакет «%s». Он был в составе RemoveSkipList"
#: ../src/up2date_client/up2dateErrors.py:227
msgid "GPG is not installed properly."
@@ -1408,7 +1411,7 @@ msgstr "GPG не установлен корректно."
#: ../src/up2date_client/up2dateErrors.py:237
msgid "GPG keyring does not include the Red Hat, Inc. public package-signing key"
msgstr ""
-"Доступные ключи GPG не включают публичного ключа Red Hat Inc. для подписи "
+"Доступные ключи GPG не включают открытого ключа Red Hat Inc. для подписи "
"пакетов"
#: ../src/up2date_client/up2dateErrors.py:249
@@ -1417,8 +1420,8 @@ msgid ""
"The package %s failed its gpg signature verification. This means the package "
"is corrupt."
msgstr ""
-"Пакет %s не прошел проверку на корректность gpg подписи. Это означает, что "
-"пакет поврежден."
+"Пакет %s не прошёл проверку GPG-подписи. Это означает, что "
+"пакет повреждён."
#: ../src/up2date_client/up2dateErrors.py:263
#, python-format
@@ -1428,7 +1431,7 @@ msgstr "Пакет %s не имеет подписи GPG.\n"
#: ../src/up2date_client/up2dateErrors.py:276
#, python-format
msgid "Package %s has a untrusted GPG signature.\n"
-msgstr "Пакет %s подписан неизвестной подписью GPG.\n"
+msgstr "Пакет %s подписан ненадёжной подписью GPG.\n"
#: ../src/up2date_client/up2dateErrors.py:289
#, python-format
@@ -1468,6 +1471,18 @@ msgid ""
"retry to avoid\n"
" requiring a Management entitlement."
msgstr ""
+"\n"
+" Недостаточно полномочий управления для регистрации системы в\n"
+" Red Hat Network. Сообщите об этом вашему администратору организации.\n"
+" После освобождения организацией существующих или \n"
+" приобретения новых полномочий вы сможете зарегистрировать систему.\n"
+" Новые полномочия администратор может приобрести после авторизации в "
+" Red Hat Network на странице «Ваша RHN - Управление подпиской».\n"
+" \n"
+" Типичная причина этой ошибки — неверная настройка\n"
+" ключа активации как используемого по умолчанию универсального ключа.\n"
+" В этом случае можно отключить ключ и постараться избегать необходимости\n"
+" использования полномочия управления."
#: ../src/firstboot/rhn_choose_server_gui.py:40 ../data/rh_register.glade.h:43
msgid "Choose Server"
@@ -1488,11 +1503,11 @@ msgstr "Подключение к Red Hat Network"
#: ../src/firstboot/rhn_finish_gui.py:39
msgid "Finish Updates Setup"
-msgstr "Завершить настройку"
+msgstr "Завершение настройки обновлений"
#: ../src/firstboot/rhn_login_gui.py:54
msgid "Red Hat Login"
-msgstr "Учетная запись Red Hat"
+msgstr "Учётная запись Red Hat"
#: ../src/firstboot/rhn_login_gui.py:56 ../src/firstboot/rhn_start_gui.py:41
msgid "Register with Red Hat Network"
@@ -1505,11 +1520,11 @@ msgstr "Произошла ошибка соединения с сервером
#: ../src/firstboot/rhn_login_gui.py:106
msgid "Would you like to try changing the network configuration and trying again?"
-msgstr "Желаете ли вы изменить сетевую конфигурацию и повторить попытку?"
+msgstr "Изменить сетевую конфигурацию и повторить попытку?"
#: ../src/firstboot/rhn_provide_certificate_gui.py:40
msgid "Provide Certificate"
-msgstr "Предоставить сертификат"
+msgstr "Предоставление сертификата"
#: ../src/firstboot/rhn_provide_certificate_gui.py:42
msgid "Provide a certificate for this Red Hat Network server"
@@ -1521,16 +1536,14 @@ msgstr "Просмотр подписки"
#: ../src/firstboot/rhn_start_gui.py:39
msgid "Set Up Software Updates"
-msgstr ""
-"Настроить\n"
-"обновления ПО"
+msgstr "Настроить обновления ПО"
#: ../src/bin/rhn-profile-sync.py:34
msgid ""
"You need to register this system by running `rhn_register` before using this "
"option"
msgstr ""
-"Необходимо зарегистрировать систему запустив `rhn_register` до использования "
+"Необходимо зарегистрировать систему, запустив «rhn_register» до использования "
"этой опции"
#: ../src/bin/rhn-profile-sync.py:42
@@ -1539,11 +1552,11 @@ msgstr "Обновление профиля пакетов..."
#: ../src/bin/rhn-profile-sync.py:45
msgid "Updating hardware profile..."
-msgstr "Обновляются данные об используемом оборудовании..."
+msgstr "Обновляется профиль оборудования..."
#: ../src/bin/rhn-profile-sync.py:49
msgid "Updating virtualization profile..."
-msgstr "Обновление профиля виртуализации..."
+msgstr "Обновляется профиль виртуализации..."
#: ../src/bin/rhn_register.py:36
msgid "Do not attempt to use X"
@@ -1563,11 +1576,11 @@ msgstr "Укажите пароль"
#: ../src/bin/rhnreg_ks.py:50
msgid "Specify an organizational id for this system"
-msgstr "Укажите id системы в организации"
+msgstr "Укажите ID системы в организации"
#: ../src/bin/rhnreg_ks.py:52
msgid "Specify a url to use as a server"
-msgstr "Укажите url сервера"
+msgstr "Укажите URL сервера"
#: ../src/bin/rhnreg_ks.py:54
msgid "Specify a file to use as the ssl CA cert"
@@ -1587,7 +1600,7 @@ msgstr "[Устарело] Прочитать контактную информ
#: ../src/bin/rhnreg_ks.py:62
msgid "Do not probe or upload any hardware info"
-msgstr "Не пытаться определить или загрузить информацию об оборудовании"
+msgstr "Не пытаться определять или передавать информацию об оборудовании"
#: ../src/bin/rhnreg_ks.py:64
msgid "Do not profile or upload any package info"
@@ -1595,7 +1608,7 @@ msgstr "Не передавать или сохранять в профиль и
#: ../src/bin/rhnreg_ks.py:66
msgid "Do not upload any virtualization info"
-msgstr "Не загружать информацию о виртуализации"
+msgstr "Не передавать информацию о виртуализации"
#: ../src/bin/rhnreg_ks.py:68
msgid "Do not start rhnsd after completion"
@@ -1612,7 +1625,7 @@ msgstr "Имя пользователя и пароль обязательны
#: ../src/bin/rhnreg_ks.py:85
msgid "This system is already registered. Use --force to override"
msgstr ""
-"Данная система уже зарегистрирована. Используйте --force для принудительной "
+"Система уже зарегистрирована. Используйте -«force» для принудительной "
"регистрации"
#: ../src/bin/rhnreg_ks.py:119
@@ -1636,7 +1649,7 @@ msgid ""
"A profilename was not specified, and hostname and IP address could not be "
"determined to use as a profilename, please specify one."
msgstr ""
-"Название профиля (profilename) не указано, а имя узла и IP адрес не могут "
+"Название профиля не указано, а имя узла и IP-адрес не могли "
"быть определены для использования в качестве названия. Пожалуйста, "
"задайте название профиля."
@@ -1650,7 +1663,7 @@ msgstr "Создать свой системный профиль"
#: ../data/gui.glade.h:3
msgid "Enter your account information"
-msgstr "Введите информацию о вашей учетной записи"
+msgstr "Введите информацию о вашей учётной записи"
#: ../data/gui.glade.h:4
msgid "Provide a security certificate"
@@ -1666,7 +1679,7 @@ msgstr "Выберите выпуск ОС"
#: ../data/progress.glade.h:1
msgid "Progress Dialog"
-msgstr "Состояние выполнения"
+msgstr "Степень выполнения"
#: ../data/rh_register.glade.h:1
msgid ""
@@ -1716,9 +1729,7 @@ msgstr "<b>ID системы:</b>"
msgid ""
"<b>The network connection on your system is not active. Your system cannot "
"be set up for software updates at this time.</b>"
-msgstr ""
-"<b>В системе нет активного сетевого соединения. Она не может быть настроена "
-"на получение обновлений ПО.</b>"
+msgstr "<b>В системе нет активного сетевого соединения. Получение обновлений ПО не может быть настроено.</b>"
#: ../data/rh_register.glade.h:13
msgid ""
@@ -1731,17 +1742,14 @@ msgid ""
"<b>Warning:</b> You will <b>not</b> be able to limit this system to a minor "
"release that is older than the most recent minor release if you select this "
"option."
-msgstr ""
+msgstr "<b>Предупреждение:</b> при выборе этой опции вы <b>не</b> сможете ограничить систему вспомогательным выпуском, версия которого старше версии последнего выпуска."
#: ../data/rh_register.glade.h:15
msgid ""
"<b>You have no active subscriptions available in your account.</b> You will "
"need to do one of the following to create an active subscription in your "
"account before this system can be registered:"
-msgstr ""
-"<b>У вашей учетной записи нет активных подписок.</b> Выполните следующее для "
-"создания активной подписки, для того чтобы ваша система могла подключиться к "
-"Red Hat Network:"
+msgstr "<b>У вашей учётной записи нет активных подписок.</b> Чтобы создать активную подписку для последующей регистрации системы, выполните одно из следующих:"
#: ../data/rh_register.glade.h:16
msgid "<b>Your system was registered for updates during installation.</b>"
@@ -1753,7 +1761,7 @@ msgid ""
"if kept updated, will always be equivalent to the latest available minor "
"release of Red Hat Enterprise Linux 5. It will be registered to the main "
"'Red Hat Enterprise Linux 5' software channel."
-msgstr ""
+msgstr "<b>_Все доступные обновления</b> будут предоставлены этой системе, обеспечив тем самым её соответствие последнему вспомогательному выпуску Red Hat Enterprise Linux 5. Система будет сопоставлена каналу «Red Hat Enterprise Linux 5»."
#: ../data/rh_register.glade.h:18
msgid ""
@@ -1799,15 +1807,15 @@ msgid ""
"<small>Tip: Forgot your login or password? Contact your Satellite's "
"<i>Organization Administrator</i>.</small>"
msgstr ""
-"<small>Замечание: Забыли имя пользователя или пароль? Обратитесь к вашему "
-"<i>Администратору организации</i> Satellite. </small>"
+"<small>Подсказка: забыли имя пользователя или пароль? Обратитесь к вашему "
+"<i>администратору организации</i> Satellite. </small>"
#: ../data/rh_register.glade.h:27
msgid ""
"<small>Tip: Forgot your login or password? Look it up at \n"
"https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small>"
msgstr ""
-"<small>Замечание: Забыли имя пользователя или пароль? Перейдите к\n"
+"<small>Подсказка: забыли имя пользователя или пароль? Перейдите на\n"
"https://www.redhat.com/wapps/sso/rhn/lostPassword.html</small>"
#: ../data/rh_register.glade.h:30
@@ -1822,13 +1830,12 @@ msgid ""
msgstr ""
"В вашей системе не найден сертификат безопасности, совместимый с <b>%s</b>.\n"
"\n"
-"Сертификат безопасности, использующий технологию SSL, нужен для обеспечения "
-"защиты данных, передаваемых между системой и Red Hat Network (включая имя "
+"Сертификат безопасности, использующий технологию SSL, нужен для защиты данных, передаваемых между системой и Red Hat Network (включая имя "
"входа и пароль)."
#: ../data/rh_register.glade.h:34
msgid "Activate a previously purchased subscription you have not yet activated."
-msgstr "Активируйте ранее приобретенную, но не активную подписку."
+msgstr "Активируйте ранее приобретённую, но неактивную подписку."
#: ../data/rh_register.glade.h:35
msgid "Advanced Network Configuration"
@@ -1843,21 +1850,21 @@ msgid ""
"Are you sure you don't want to connect your system to Red Hat Network? "
"You'll miss out on the benefits of a Red Hat Enterprise Linux subscription:"
msgstr ""
-"Вы уверены в том, что вы не хотите подключить вашу систему к Red Hat "
+"Вы уверены, что вы не хотите подключить систему к Red Hat "
"Network? Вы не сможете воспользоваться преимуществами подписки Red Hat "
"Enterprise Linux."
#: ../data/rh_register.glade.h:39
msgid "CPU Model:"
-msgstr "Модель процессора (CPU):"
+msgstr "Модель CPU:"
#: ../data/rh_register.glade.h:40
msgid "CPU Speed:"
-msgstr "Частота процессора:"
+msgstr "Частота CPU:"
#: ../data/rh_register.glade.h:41
msgid "Certificate _Location:"
-msgstr "Местоположение с_ертификата:"
+msgstr "Расположение с_ертификата:"
#: ../data/rh_register.glade.h:42
msgid "Choose Channel"
@@ -1877,11 +1884,11 @@ msgstr "ОШИБКА"
#: ../data/rh_register.glade.h:49
msgid "Enter Your Account Information"
-msgstr "Введите информацию о вашей учетной записи"
+msgstr "Введите информацию о вашей учётной записи"
#: ../data/rh_register.glade.h:50
msgid "Enter in the format hostname(:port)"
-msgstr "Ввод в формате hostname(:port)"
+msgstr "Ввод в формате «узел(:порт)»"
#: ../data/rh_register.glade.h:51
msgid "Hardware Info"
@@ -1893,7 +1900,7 @@ msgstr "Профиль оборудования"
#: ../data/rh_register.glade.h:53
msgid "Hostname:"
-msgstr "Имя узла:"
+msgstr "Узел:"
#: ../data/rh_register.glade.h:54
msgid ""
@@ -1918,19 +1925,19 @@ msgstr "У меня есть <b>сертификат _SSL</b> для соеди
#: ../data/rh_register.glade.h:57
msgid "I would like to connect to Red Hat Network via an _HTTP proxy."
-msgstr "Я хочу подключаться к Red Hat Network через _HTTP proxy."
+msgstr "Я хочу подключаться к Red Hat Network через _HTTP-прокси."
#: ../data/rh_register.glade.h:58
msgid ""
"I'd like to receive updates from <b>Red Hat Network</b>. (I don't have "
"access to a Red Hat Network Satellite or Proxy.)"
msgstr ""
-"Я хочу получать обновления от <b>Red Hat Network</b>. (У меня нет доступа к "
+"Я хочу получать обновления от <b>Red Hat Network</b> (у меня нет доступа к "
"Red Hat Network Satellite или Proxy)."
#: ../data/rh_register.glade.h:59
msgid "IP Address:"
-msgstr "IP адрес:"
+msgstr "IP-адрес:"
#: ../data/rh_register.glade.h:60
msgid "Installation _Number:"
@@ -1938,7 +1945,7 @@ msgstr "Код _установки:"
#: ../data/rh_register.glade.h:62
msgid "Link To Subscription"
-msgstr "Перейти к подписке"
+msgstr "Сопоставить подписке"
#: ../data/rh_register.glade.h:63
msgid ""
@@ -1946,8 +1953,8 @@ msgid ""
"RHN > Subscription Management > System Entitlements."
msgstr ""
"Выполните вход в http://rhn.redhat.com/ и отмените все полномочия для "
-"неактивной системы через Ваша RHN > Управление подпиской > Полномочия "
-"системы."
+"неактивной системы через «Ваша RHN > Управление подпиской > Полномочия "
+"системы»."
#: ../data/rh_register.glade.h:64
msgid "Memory:"
@@ -1961,7 +1968,7 @@ msgstr "Сведения о пакете"
msgid ""
"Please enter your account information for <b>Red Hat Network</b> (http://rhn."
"redhat.com/)"
-msgstr "Введите данные учетной записи <b>Red Hat Network</b> (http://rhn.redhat.com)"
+msgstr "Введите данные учётной записи <b>Red Hat Network</b> (http://rhn.redhat.com)"
#: ../data/rh_register.glade.h:68
msgid "Provide a Security Certificate"
@@ -1989,8 +1996,8 @@ msgid ""
"this Red Hat Enterprise Linux system <b>updated</b> and <b>secure</b>."
msgstr ""
"Получайте последние обновления ПО, включая обновления безопасности, тем "
-"самым сохраняя систему Red Hat Enterprise Linux в <b>обновленном</b> и "
-"<b>защищенном</b> состоянии."
+"самым поддерживая систему Red Hat Enterprise Linux в <b>обновлённом</b> и "
+"<b>защищённом</b> состоянии."
#: ../data/rh_register.glade.h:73
msgid "Red Hat Linux Version:"
@@ -2002,7 +2009,7 @@ msgstr "_Расположение Red Hat Network:"
#: ../data/rh_register.glade.h:75
msgid "Review system..."
-msgstr "Анализ системы..."
+msgstr "Просмотр системы..."
#: ../data/rh_register.glade.h:76
msgid "Select A File"
@@ -2048,17 +2055,16 @@ msgid ""
"menu."
msgstr ""
"Без подключения к серверу Red Hat Network вы <b>не</b> сможете получать "
-"обновления ПО, в том числе обновлений безопасности Red Hat для данной "
+"обновления ПО, в том числе обновления безопасности Red Hat для данной "
"системы.\n"
"\n"
-"Для поддержания системы в обновленном и защищенном состоянии, "
-"зарегистрируйте ее как можно раньше. Доступ к утилите регистрации возможен "
-"через запуск <b>Обновление ПО</b> в меню <b>Приложения > Системные "
-"параметры</b>. "
+"Для поддержания системы в обновлённом и защищённом состоянии "
+"зарегистрируйте её как можно раньше. Доступ к программе регистрации возможен "
+"через запуск <b>Обновление пакетов</b> в меню <b>Приложения > Система</b>. "
#: ../data/rh_register.glade.h:88
msgid "Use Au_thentication with HTTP Proxy:"
-msgstr "Использовать а_утентификацию HTTP Proxy:"
+msgstr "А_утентификация на HTTP Proxy:"
#: ../data/rh_register.glade.h:89
msgid "V_iew Package Profile ..."
@@ -2072,7 +2078,7 @@ msgstr "Зачем регистрироваться"
msgid ""
"Would you like to register your system at this time? <b>(Strongly "
"recommended.)</b>"
-msgstr "Зарегистрировать систему сейчас? <b>(Строго рекомендуется)</b>"
+msgstr "Зарегистрировать систему сейчас? <b>(настоятельно рекомендуется)</b>"
#: ../data/rh_register.glade.h:93
msgid ""
@@ -2080,7 +2086,7 @@ msgid ""
"com/) or to a <b>Red Hat Network Satellite</b> or <b>Red Hat Network Proxy</"
"b> in order to receive software updates."
msgstr ""
-"Вы можете подключить свою систему к <b>Red Hat Network</b> (https://rhn."
+"Вы можете подключить систему к <b>Red Hat Network</b> (https://rhn."
"redhat.com/), <b>Red Hat Network Satellite</b> или <b>Red Hat Network Proxy</"
"b> для получения обновлений ПО."
@@ -2102,19 +2108,19 @@ msgid ""
"updates setup tool at any time by running Software Updater in the "
"Applications > System Tools menu."
msgstr ""
-"Вы не сможете получать обновления ПО, в том числе обновлений безопасности "
+"Вы не сможете получать обновления ПО, в том числе обновления безопасности "
"для данной системы.\n"
"\n"
-"Для поддержания системы в обновленном и защищенном состоянии, "
-"зарегистрируйте ее в RHN как можно раньше. Доступ к утилите регистрации "
-"возможен через запуск Обновление ПО в меню Приложения > Системные параметры."
+"Для поддержания системы в обновлённом и защищённом состоянии "
+"зарегистрируйте её в RHN как можно раньше. Доступ к программе регистрации "
+"возможен через запуск «Обновление пакетов» в меню «Приложения > Система»."
#: ../data/rh_register.glade.h:98
msgid ""
"You'll need to send us a profile of what packages and hardware are installed "
"on your system so we can determine what updates are available."
msgstr ""
-"Чтобы мы могли определить подходящие вашей системе обновления, вам нужно "
+"Чтобы мы смогли определить подходящие вашей системе обновления, нужно "
"предоставить информацию об оборудовании и установленных в системе пакетах."
#: ../data/rh_register.glade.h:99
@@ -2122,7 +2128,7 @@ msgid ""
"You'll want to choose a name for this system so you'll be able to identify "
"it in the Red Hat Network interface."
msgstr ""
-"Можно выбрать имя для системы для ее легкого нахождения в интерфейсе Red Hat "
+"Можно выбрать имя системы для её идентификации в интерфейсе Red Hat "
"Network."
#: ../data/rh_register.glade.h:100
@@ -2139,12 +2145,11 @@ msgid ""
"circled below.) Clicking on this icon, when available, will guide you "
"through applying any updates that are available:"
msgstr ""
-"Система готова к получению обновлений ПО, которые обеспечат ее безопасность "
+"Система готова к получению обновлений ПО, которые обеспечат её безопасность "
"и поддержку.\n"
"\n"
-"Обновления ПО доступны, если значок уведомления появился на рабочем столе "
-"(обычно в правом верхнем углу). При нажатии этого значка начнется пошаговая "
-"установка доступных обновлений:"
+"Индикатором наличия программных обновлений служит появление значка уведомления на рабочем столе (обычно в правом верхнем углу). "
+"Нажмите этот значок, чтобы начать пошаговую установку обновлений:"
#: ../data/rh_register.glade.h:104
msgid ""
@@ -2166,7 +2171,7 @@ msgid ""
"Your system will be subscribed to the base software channel. You will not "
"be able to move this system to an earlier minor release channel if you "
"continue (you will be able to move to a later release.)"
-msgstr ""
+msgstr "Ваша система будет подписана на основной программный канал. Вы не сможете переназначить систему предыдущему вспомогательному выпуску (но можно переназначить более позднему выпуску)."
#: ../data/rh_register.glade.h:108
msgid ""
@@ -2174,7 +2179,7 @@ msgid ""
"your system updated, secure, and supported."
msgstr ""
"Необходимо получить доступ к подписке, что позволит поддерживать систему в "
-"обновленном и защищенном состоянии."
+"обновлённом и защищённом состоянии."
#: ../data/rh_register.glade.h:109
msgid "_Activate a subscription now..."
@@ -2198,7 +2203,7 @@ msgstr "_Нет, спасибо. Я зарегистрируюсь позже."
#: ../data/rh_register.glade.h:114
msgid "_No, Cancel"
-msgstr "_Нет, отмена"
+msgstr "_Нет, отменить"
#: ../data/rh_register.glade.h:115
msgid "_No, I prefer to register at a later time."
@@ -2222,7 +2227,7 @@ msgstr "_Вернуться к регистрации"
#: ../data/rh_register.glade.h:120
msgid "_Take me back to the setup process."
-msgstr "_Вернуться к установке"
+msgstr "_Вернуться к настройке"
#: ../data/rh_register.glade.h:121
msgid "_View Hardware Profile ..."
@@ -2266,7 +2271,7 @@ msgstr "Регистрация в RHN"
#: ../rhn_register.desktop.in.h:2
msgid "Register for software updates from Spacewalk/Satellite/Red Hat Network"
-msgstr "Регистрация для получения программных обновлений из Spacewalk/Satellite/Red Hat Network"
+msgstr "Регистрация для получения программных обновлений от Spacewalk/Satellite/Red Hat Network"
#: ../rhn_register.desktop.in.h:3
msgid "Register to Spacewalk/Satellite/Red Hat Network."
commit 56f268a138aa05ef759ce2e61a6b973923c5c074
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Jun 7 20:37:22 2010 +0200
600316 - don't traceback for zero subscribed channels
diff --git a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
index 72aa70d..30e1d48 100644
--- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
+++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
@@ -82,7 +82,10 @@ def main():
if OPTIONS.verbose:
print "Channel(s): %s successfully removed" % ', '.join(OPTIONS.channel)
elif OPTIONS.list:
- channels = map(lambda x: x['label'], getChannels().channels())
+ try:
+ channels = map(lambda x: x['label'], getChannels().channels())
+ except up2dateErrors.NoChannelsError:
+ systemExit(1, 'This system is not associated with any channel.')
channels.sort()
print '\n'.join(channels)
else:
14 years
2 commits - 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/Server.pm | 60 -------------
web/modules/rhn/RHN/DB/ServerActions.pm | 42 ---------
web/modules/sniglets/Sniglets/Channel.pm | 68 ---------------
web/modules/sniglets/Sniglets/ListView/SystemList.pm | 84 -------------------
10 files changed, 487 deletions(-)
New commits:
commit 59a24c76ec52099cdea609e94923d3af4e34c57e
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;
commit 9a8fd0ea078028d26f273d1c61f2f2409e7a119d
Author: Partha Aji <paji(a)redhat.com>
Date: Thu May 27 20:23:29 2010 -0400
removed an unused method
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 2163844..1bde1f5 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -1764,66 +1764,6 @@ sub can_entitle_server {
return $can ? 1 : 0;
}
-sub set_channels {
- my $self = shift;
- my %params = validate(@_, {user_id => 1, channels => 1});
- my %new_channels = map { $_ => 1 } @{$params{channels}};
- my $user_id = $params{user_id};
-
- my @remove;
- my @add;
-
- my $dbh = RHN::DB->connect;
- my $query = <<EOS;
-SELECT SC.channel_id
- FROM rhnServerChannel SC
- WHERE SC.server_id = ?
-EOS
-
- my $sth = $dbh->prepare($query);
- $sth->execute($self->id);
-
- while (my ($cid) = $sth->fetchrow) {
- if (exists $new_channels{$cid}) {
- delete $new_channels{$cid};
- }
- else {
- push @remove, $cid;
- }
- }
-
- @add = keys %new_channels;
- foreach my $add (@add) {
-
- # do quick unsubscribe + quick subscribe
- my $sth = $dbh->prepare(<<EOS);
-BEGIN
- rhn_channel.unsubscribe_server(:server_id, :cid, 0);
- rhn_channel.subscribe_server(:server_id, :cid, 0, :user_id);
-END;
-EOS
- $sth->execute_h(server_id => $self->id, cid => $add, user_id => $user_id);
- }
-
- foreach my $remove (@remove) {
- # do quick unsubscribes
- my $sth = $dbh->prepare(<<EOS);
-BEGIN
- rhn_channel.unsubscribe_server(:server_id, :cid, 0);
-END;
-EOS
- $sth->execute_h(server_id => $self->id, cid => $remove);
- }
-
- # manually recompute the cache so that it's immediate
- my ($add, $remove, $unc) = RHN::DB::Server->update_cache_for_server($dbh, $self->id);
-
- $dbh->commit;
-
- return { added => [ @add ],
- removed => [ @remove ],
- };
-}
sub entitle_server {
my $self_or_class = shift;
14 years
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 5 ++-
java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java | 4 --
java/code/src/com/redhat/rhn/frontend/dto/ContentSourceDto.java | 16 ++++++++++
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 7 ++++
java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp | 7 ++++
5 files changed, 35 insertions(+), 4 deletions(-)
New commits:
commit 0806217702dd4f98dd3f0dc69c39e484a7ddc8b1
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 8 16:23:06 2010 -0400
add channel count access for repo objects
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 2820086..c2f6b4b 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
@@ -1033,7 +1033,10 @@ SELECT CP.package_id, CP.name_id, CP.evr_id, CP.package_arch_id
<mode name="contentsrc_for_org" class="com.redhat.rhn.frontend.dto.ContentSourceDto">
<query params="org_id">
- SELECT CS.id, CS.label
+ SELECT CS.id, CS.label,
+ (SELECT count(ccs.channel_id)
+ FROM rhnChannelContentSource ccs
+ WHERE ccs.source_id = CS.id) as channels
FROM rhnContentSource CS
WHERE CS.org_id = :org_id
</query>
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
index c0e374a..675d393 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
@@ -15,7 +15,6 @@
package com.redhat.rhn.frontend.action.channel.manage;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -57,8 +56,7 @@ public class SyncRepositoriesAction extends RhnAction implements Listable {
params.put(RequestContext.CID, chan.getId().toString());
ListSessionSetHelper helper = new ListSessionSetHelper(this, request,params);
-
- //helper.ignoreEmptySelection();
+
helper.execute();
if(helper.isDispatched()) {
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/ContentSourceDto.java b/java/code/src/com/redhat/rhn/frontend/dto/ContentSourceDto.java
index 0dd693e..293df08 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/ContentSourceDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/ContentSourceDto.java
@@ -22,6 +22,7 @@ package com.redhat.rhn.frontend.dto;
public class ContentSourceDto extends BaseDto {
private Long id;
+ private Long channels;
private String label;
/**
@@ -52,6 +53,21 @@ public class ContentSourceDto extends BaseDto {
public void setLabel(String labelIn) {
this.label = labelIn;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public Long getChannels() {
+ return channels;
+ }
+
+ /**
+ * @param idIn The id to set.
+ */
+ public void setChannels(Long cIn) {
+ this.channels = cIn;
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index d196c63..3c6bdba 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -6617,6 +6617,13 @@ value for this entitlement, excluding the default organization's consumption.</s
</context-group>
</trans-unit>
+ <trans-unit id="repo.jsp.channels">
+<source>Channels</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/channels/manage/repos/RepoList</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="download.jsp.package">
<source>Package</source>
<context-group name="ctx">
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
index 9657baa..761c576 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repos.jsp
@@ -39,6 +39,13 @@
filterattr="label">
<c:out value="<a href=\"/rhn/channels/manage/repos/RepoEdit.do?id=${current.id}\">${current.label}</a>" escapeXml="false" />
</rl:column>
+ <rl:column bound="false"
+ sortable="false"
+ headerkey="repo.jsp.channels"
+ attr="channels"
+ styleclass="last-column">
+ <c:out value="${current.channels}" />
+ </rl:column>
</rl:list>
</rl:listset>
14 years
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java | 26 +---------
java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp | 2
java/code/webapp/WEB-INF/struts-config.xml | 2
3 files changed, 7 insertions(+), 23 deletions(-)
New commits:
commit 2d4f4c0dd59b25aefaf3cf876f6f37873225938c
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 8 15:16:03 2010 -0400
general repo cleanup, bugfixing
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
index 157949a..c0e374a 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
@@ -57,33 +57,17 @@ public class SyncRepositoriesAction extends RhnAction implements Listable {
params.put(RequestContext.CID, chan.getId().toString());
ListSessionSetHelper helper = new ListSessionSetHelper(this, request,params);
-
- if (!context.isSubmitted()) {
- List<ContentSource> result = getResult(context);
- Set<String> preSelect = new HashSet<String>();
- for (int i = 0; i < result.size(); i++) {
- ContentSource src = result.get(i);
- if(src.getChannels().contains(chan)) {
- preSelect.add(src.getId().toString());
- }
- }
- helper.preSelect(preSelect);
- }
-
- helper.ignoreEmptySelection();
+
+ //helper.ignoreEmptySelection();
helper.execute();
- if(helper.isDispatched()) {
- Set<ContentSource> foo = chan.getSources();
- foo.clear();
+ if(helper.isDispatched()) {
Set <String> set = helper.getSet();
for (String id : set) {
Long sgid = Long.valueOf(id);
ContentSource tmp = ChannelFactory.lookupContentSource(sgid);
- foo.add(tmp);
- }
-
- ChannelFactory.save(chan);
+ System.out.println("SYNCING:" + tmp.getSourceUrl());
+ }
StrutsDelegate strutsDelegate = getStrutsDelegate();
strutsDelegate.saveMessage("channel.edit.repo.updated", new String[] {chan.getName()}, request );
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp
index 96180fc..a96bb4e 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp
@@ -45,7 +45,7 @@
<div align="right">
<hr />
<input type="submit" name="dispatch"
- value="<bean:message key="repos.jsp.update.channel"/>" />
+ value="<bean:message key="Sync"/>" />
</div>
<rhn:submitted/>
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index 3134180..1871f93 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -6493,7 +6493,7 @@
type="com.redhat.rhn.frontend.action.channel.manage.SyncRepositoriesAction"
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
<forward name="default" path="/WEB-INF/pages/channel/manage/syncrepos.jsp" />
- <forward name="success" path="/channels/manage/SyncRepositories.do" redirect="true" />
+ <forward name="success" path="/channels/manage/Edit.do" redirect="true" />
</action>
<action path="/channels/manage/Manage"
14 years
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java | 15 +
java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml | 9
java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java | 104 ++++++++++
java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp | 55 +++++
4 files changed, 183 insertions(+)
New commits:
commit c9bd1c458c2e4d99fecd2268c145d52e1d3cbe7c
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 8 13:36:38 2010 -0400
new page: list of repos to sync (session sets)
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 ce9ca82..b0022da 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
@@ -145,6 +145,21 @@ public class ChannelFactory extends HibernateFactory {
}
/**
+ * Lookup a content source by org/channel
+ * @param org the org to lookup
+ * @param c the channel
+ * @return the ContentSource(s)
+ */
+ public static List<ContentSource> lookupContentSources(Org org, Channel c) {
+ Map params = new HashMap();
+ params.put("org", org);
+ params.put("channel", c);
+ return singleton.listObjectsByNamedQuery(
+ "ContentSource.findByOrgandChannel", params);
+ }
+
+
+ /**
* lookup content source by id and org
* @param id
* @param orgIn
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
index 0225674..b0a7aad 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
@@ -46,8 +46,17 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
</query>
<query name="ContentSource.findByOrg">
<![CDATA[from com.redhat.rhn.domain.channel.ContentSource as c where c.org = :org]]>
+ </query>
+ <query name="ContentSource.findByOrgandChannel">
+ <![CDATA[SELECT cs from com.redhat.rhn.domain.channel.ContentSource as cs,
+ com.redhat.rhn.domain.channel.Channel as c
+ where cs.org = :org
+ and c = :channel
+ and cs in elements(c.sources)
+ ]]>
</query>
+
</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
new file mode 100644
index 0000000..157949a
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/SyncRepositoriesAction.java
@@ -0,0 +1,104 @@
+/**
+ * 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.action.channel.manage;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import com.redhat.rhn.domain.channel.Channel;
+import com.redhat.rhn.domain.channel.ChannelFactory;
+import com.redhat.rhn.domain.channel.ContentSource;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.struts.RequestContext;
+import com.redhat.rhn.frontend.struts.RhnAction;
+import com.redhat.rhn.frontend.struts.StrutsDelegate;
+import com.redhat.rhn.frontend.taglibs.list.helper.ListSessionSetHelper;
+import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
+
+
+public class SyncRepositoriesAction extends RhnAction implements Listable {
+
+
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm formIn,
+ HttpServletRequest request,
+ HttpServletResponse response) {
+
+ RequestContext context = new RequestContext(request);
+ User user = context.getLoggedInUser();
+
+ long cid = context.getRequiredParam("cid");
+ Channel chan = ChannelFactory.lookupByIdAndUser(cid, user);
+ request.setAttribute("channel_name", chan.getName());
+
+ Map params = new HashMap();
+ params.put(RequestContext.CID, chan.getId().toString());
+
+ ListSessionSetHelper helper = new ListSessionSetHelper(this, request,params);
+
+ if (!context.isSubmitted()) {
+ List<ContentSource> result = getResult(context);
+ Set<String> preSelect = new HashSet<String>();
+ for (int i = 0; i < result.size(); i++) {
+ ContentSource src = result.get(i);
+ if(src.getChannels().contains(chan)) {
+ preSelect.add(src.getId().toString());
+ }
+ }
+ helper.preSelect(preSelect);
+ }
+
+ helper.ignoreEmptySelection();
+ helper.execute();
+
+ if(helper.isDispatched()) {
+ Set<ContentSource> foo = chan.getSources();
+ foo.clear();
+ Set <String> set = helper.getSet();
+ for (String id : set) {
+ Long sgid = Long.valueOf(id);
+ ContentSource tmp = ChannelFactory.lookupContentSource(sgid);
+ foo.add(tmp);
+ }
+
+ ChannelFactory.save(chan);
+
+ StrutsDelegate strutsDelegate = getStrutsDelegate();
+ strutsDelegate.saveMessage("channel.edit.repo.updated", new String[] {chan.getName()}, request );
+
+ return strutsDelegate.forwardParams
+ (mapping.findForward("success"), params);
+ }
+
+ return mapping.findForward("default");
+ }
+
+ public List<ContentSource> getResult(RequestContext context) {
+ User user = context.getLoggedInUser();
+ long cid = context.getRequiredParam("cid");
+ Channel chan = ChannelFactory.lookupByIdAndUser(cid, user);
+ return ChannelFactory.lookupContentSources(user.getOrg(), chan);
+ }
+}
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp
new file mode 100644
index 0000000..96180fc
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/syncrepos.jsp
@@ -0,0 +1,55 @@
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %>
+
+<html:xhtml/>
+<html>
+<head>
+ <meta name="page-decorator" content="none" />
+</head>
+<body>
+
+<%@ include file="/WEB-INF/pages/common/fragments/channel/manage/manage_channel_header.jspf" %>
+<BR>
+
+<h2><img src="/img/rhn-icon-packages.gif"> <bean:message key="repos.jsp.channel.repos"/></h2>
+
+<rl:listset name="packageSet">
+
+<input type="hidden" name="cid" value="${cid}" />
+
+ <rl:list
+ decorator="SelectableDecorator"
+ emptykey="repos.jsp.norepos"
+ alphabarcolumn="label"
+ >
+
+ <rl:decorator name="PageSizeDecorator"/>
+
+ <rl:selectablecolumn value="${current.id}"
+ styleclass="first-column"/>
+
+ <rl:column sortable="true"
+ bound="false"
+ headerkey="repos.jsp.channel.header"
+ sortattr="label"
+ defaultsort="asc"
+ >
+
+ <a href="/rhn/channels/manage/repos/RepoEdit.do?id=${current.id}">${current.label}</a>
+ </rl:column>
+
+ </rl:list>
+ <div align="right">
+ <hr />
+ <input type="submit" name="dispatch"
+ value="<bean:message key="repos.jsp.update.channel"/>" />
+ </div>
+ <rhn:submitted/>
+
+</rl:listset>
+
+</body>
+</html>
\ No newline at end of file
14 years
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/webapp/WEB-INF/struts-config.xml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 97f1670b767f4d562c4ea3217d1a039632752c6c
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Tue Jun 8 12:33:51 2010 -0400
struts support for repo sync action
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index edc56fd..3134180 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -6486,7 +6486,15 @@
className="com.redhat.rhn.frontend.struts.RhnActionMapping">
<forward name="default" path="/WEB-INF/pages/channel/manage/channelrepos.jsp" />
<forward name="success" path="/channels/manage/Repositories.do" redirect="true" />
- </action>
+ </action>
+
+ <action path="/channels/manage/Sync"
+ scope="request"
+ type="com.redhat.rhn.frontend.action.channel.manage.SyncRepositoriesAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <forward name="default" path="/WEB-INF/pages/channel/manage/syncrepos.jsp" />
+ <forward name="success" path="/channels/manage/SyncRepositories.do" redirect="true" />
+ </action>
<action path="/channels/manage/Manage"
scope="request"
14 years
Branch 'fve' - backend/server schema/spacewalk
by Justin Sherrill
backend/server/handlers/xmlrpc/registration.py | 44 ++++++++--
backend/server/rhnVirtualization.py | 4
schema/spacewalk/common/data/rhnVirtualInstanceType.sql | 8 +
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/010-rhnVirtualInstanceType.sql | 9 ++
4 files changed, 57 insertions(+), 8 deletions(-)
New commits:
commit 057b94df9a61a1a8ab77b428d8039317295c9745
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Jun 8 11:53:33 2010 -0400
adding flex guest detection at registration time
diff --git a/backend/server/handlers/xmlrpc/registration.py b/backend/server/handlers/xmlrpc/registration.py
index 90e5b6f..211702b 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -69,6 +69,38 @@ def RegistrationNumber(nr):
return None
return ret
+def parse_smbios(smbios):
+ vendor = smbios.get('smbios.bios.vendor')
+ serial = smbios.get('smbios.system.serial', '')
+ manufacturer = smbios.get('smbios.system.manufacturer')
+ product = smbios.get('smbios.system.product')
+
+ # XXX need to worry about uuid being none for other virt types and
+ # available subs check
+ uuid = None
+ if smbios.has_key('smbios.system.uuid'):
+ uuid = smbios['smbios.system.uuid']
+ uuid = uuid.replace('-', '')
+
+ if vendor == "QEMU" and uuid is not None:
+ return (rhnVirtualization.VirtualizationType.QEMU, uuid)
+ elif manufacturer == 'Microsoft Corporation' and \
+ product == 'Virtual Machine':
+ if uuid is None:
+ uuid = "flex-guest"
+ return (rhnVirtualization.VirtualizationType.HYPERV, uuid)
+ elif serial.startswith('VMware-'):
+ if uuid is None:
+ uuid = "flex-guest"
+ return (rhnVirtualization.VirtualizationType.VMWARE, uuid)
+ elif manufacturer == 'HITACHI' and product.endswith(' HVM LPAR'):
+ if uuid is None:
+ uuid = "flex-guest"
+ return (rhnVirtualization.VirtualizationType.VIRTAGE, uuid)
+ else:
+ return (None, None)
+
+
class Registration(rhnHandler):
""" encapsulate functions that we will provide for the outside world """
def __init__(self):
@@ -332,15 +364,11 @@ class Registration(rhnHandler):
newserv.virt_uuid = None
newserv.virt_type = None
- # check for kvm/qemu guest info
- if data.has_key('smbios'):
- smbios = data['smbios']
- if smbios.has_key('smbios.bios.vendor') and \
- smbios['smbios.bios.vendor'] == 'QEMU' and \
- smbios.has_key('smbios.system.uuid'):
- newserv.virt_type = rhnVirtualization.VirtualizationType.FULLY
- newserv.virt_uuid = smbios['smbios.system.uuid'].replace('-', '')
+ # If we didn't find virt info from xen, check smbios
+ if data.has_key('smbios') and newserv.virt_uuid is None:
+ (newserv.virt_type, newserv.virt_uuid) = \
+ parse_smbios(data['smbios'])
if tokens_obj.forget_rereg_token:
# At this point we retained the server with re-activation
diff --git a/backend/server/rhnVirtualization.py b/backend/server/rhnVirtualization.py
index 53d0c0d..6101a99 100644
--- a/backend/server/rhnVirtualization.py
+++ b/backend/server/rhnVirtualization.py
@@ -62,6 +62,10 @@ class ServerStateType:
class VirtualizationType:
PARA = 'para_virtualized'
FULLY = 'fully_virtualized'
+ QEMU = 'qemu'
+ HYPERV = 'hyperv'
+ VMWARE = 'vmware'
+ VIRTAGE = 'virtage'
class IdentityType:
HOST = 'host'
diff --git a/schema/spacewalk/common/data/rhnVirtualInstanceType.sql b/schema/spacewalk/common/data/rhnVirtualInstanceType.sql
index 7e5a112..dfeae9d 100644
--- a/schema/spacewalk/common/data/rhnVirtualInstanceType.sql
+++ b/schema/spacewalk/common/data/rhnVirtualInstanceType.sql
@@ -24,3 +24,11 @@ insert into rhnVirtualInstanceType (id, name, label)
insert into rhnVirtualInstanceType (id, name, label)
values (rhn_vit_id_seq.nextval, 'KVM/QEMU', 'qemu');
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'VMware', 'vmware');
+
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'Hyper-V', 'hyperv');
+
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'Virtage', 'virtage');
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/010-rhnVirtualInstanceType.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/010-rhnVirtualInstanceType.sql
new file mode 100644
index 0000000..3bc88f0
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/010-rhnVirtualInstanceType.sql
@@ -0,0 +1,9 @@
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'VMware', 'vmware');
+
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'Hyper-V', 'hyperv');
+
+insert into rhnVirtualInstanceType (id, name, label)
+ values (rhn_vit_id_seq.nextval, 'Virtage', 'virtage');
+
14 years
Branch 'fve' - schema/spacewalk
by Partha Aji
schema/spacewalk/oracle/packages/rhn_channel.pkb | 230 ++++++++++++++++++-----
schema/spacewalk/oracle/packages/rhn_channel.pks | 34 ++-
2 files changed, 207 insertions(+), 57 deletions(-)
New commits:
commit 619c8955c71790f99d88f0dc61f00beed2925097
Author: Partha Aji <paji(a)redhat.com>
Date: Tue Jun 8 11:16:14 2010 -0400
Commiting the initial compilable merge of rhn_channel
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pkb b/schema/spacewalk/oracle/packages/rhn_channel.pkb
index 925dddd..53894ac 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pkb
@@ -80,7 +80,18 @@ IS
VALUES (channel_family_id_val, user_id_in, server_id_in);
END license_consent;
- PROCEDURE subscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, user_id_in in number := null, recalcfamily_in NUMBER := 1)
+ procedure obtain_read_lock(channel_family_id_in in number, org_id_in in number)
+ is
+ read_lock date;
+
+ begin
+ select created into read_lock
+ from rhnPrivateChannelFamily
+ where channel_family_id = channel_family_id_in and org_id = org_id_in
+ for update;
+ end obtain_read_lock;
+
+ PROCEDURE subscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, user_id_in in number := null, recalcfamily_in number := 1)
IS
channel_parent_val rhnChannel.parent_channel%TYPE;
parent_subscribed BOOLEAN;
@@ -89,9 +100,11 @@ IS
channel_family_id_val NUMBER;
server_org_id_val NUMBER;
available_subscriptions NUMBER;
+ available_fve_subs NUMBER;
consenting_user NUMBER;
allowed number := 0;
- current_members_val number;
+ is_fve CHAR(1) := 'N';
+
BEGIN
if user_id_in is not null then
allowed := rhn_channel.user_role_check(channel_id_in, user_id_in, 'subscribe');
@@ -159,17 +172,20 @@ IS
FROM rhnChannel
WHERE id = channel_id_in;
- select current_members
- into current_members_val
- from rhnPrivateChannelFamily
- where org_id = server_org_id_val and channel_family_id = channel_family_id_val
- for update of current_members;
+ begin
+ obtain_read_lock(channel_family_id_val, server_org_id_val);
+ exception
+ when no_data_found then
+ rhn_exception.raise_exception('channel_family_no_subscriptions');
+ end;
available_subscriptions := rhn_channel.available_family_subscriptions(channel_family_id_val, server_org_id_val);
-
- IF available_subscriptions IS NULL OR
- available_subscriptions > 0 or
- can_server_consume_virt_channl(server_id_in, channel_family_id_val) = 1
+ available_fve_subs := rhn_channel.available_fve_family_subs(channel_family_id_val, server_org_id_val);
+
+ IF available_subscriptions IS NULL OR
+ available_subscriptions > 0 or
+ can_server_consume_virt_channl(server_id_in, channel_family_id_val) = 1 OR
+ (available_fve_subs > 0 AND can_server_consume_fve(server_id_in) = 1)
THEN
IF rhn_channel.get_license_path(channel_id_in) IS NOT NULL
@@ -186,7 +202,11 @@ IS
rhn_exception.raise_exception('channel_subscribe_no_consent');
END;
END IF;
-
+
+ if can_server_consume_virt_channl(server_id_in, channel_family_id_val) = 0 AND available_fve_subs > 0 AND can_server_consume_fve(server_id_in) = 1 THEN
+ is_fve := 'Y';
+ END IF;
+
insert into rhnServerHistory (id,server_id,summary,details) (
select rhn_event_id_seq.nextval,
server_id_in,
@@ -196,7 +216,7 @@ IS
where c.id = channel_id_in
);
UPDATE rhnServer SET channels_changed = sysdate WHERE id = server_id_in;
- INSERT INTO rhnServerChannel (server_id, channel_id) VALUES (server_id_in, channel_id_in);
+ INSERT INTO rhnServerChannel (server_id, channel_id, is_fve) VALUES (server_id_in, channel_id_in, is_fve);
IF recalcfamily_in > 0
THEN
rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
@@ -239,6 +259,21 @@ IS
end;
+ FUNCTION can_server_consume_fve(server_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ CURSOR vi_entries IS
+ SELECT *
+ FROM rhnVirtualInstance
+ WHERE virtual_system_id = server_id_in;
+ vi_count NUMBER;
+
+ BEGIN
+ FOR vi_entry IN VI_ENTRIES LOOP
+ return 1;
+ END LOOP;
+ RETURN 0;
+ END;
PROCEDURE bulk_subscribe_server(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER)
IS
@@ -678,6 +713,45 @@ IS
-- otherwise, return the delta
RETURN max_members_val - current_members_val;
END available_family_subscriptions;
+
+ FUNCTION available_fve_family_subs(channel_family_id_in IN NUMBER, org_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ cfp channel_family_perm_cursor%ROWTYPE;
+ fve_current_members_val NUMBER;
+ fve_max_members_val NUMBER;
+ found NUMBER;
+
+ BEGIN
+ IF NOT channel_family_perm_cursor%ISOPEN THEN
+ OPEN channel_family_perm_cursor(channel_family_id_in, org_id_in);
+ END IF;
+
+ FETCH channel_family_perm_cursor INTO cfp;
+
+ WHILE channel_family_perm_cursor%FOUND LOOP
+ found := 1;
+ fve_current_members_val := cfp.fve_current_members;
+ fve_max_members_val := cfp.fve_max_members;
+ FETCH channel_family_perm_cursor INTO cfp;
+ END LOOP;
+
+ IF channel_family_perm_cursor%ISOPEN THEN
+ CLOSE channel_family_perm_cursor;
+ END IF;
+
+ IF found IS NULL THEN
+ RETURN 0;
+ END IF;
+
+ IF fve_max_members_val IS NULL THEN
+ RETURN NULL;
+ END IF;
+
+ RETURN fve_max_members_val - fve_current_members_val;
+
+ END available_fve_family_subs;
+
-- *******************************************************************
-- FUNCTION: channel_family_current_members
@@ -700,17 +774,42 @@ IS
return current_members_count;
end;
+
+ function cfam_curr_fve_members(
+ channel_family_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ return number
+ is
+ current_members_count number := 0;
+
+ begin
+ select count(sc.server_id)
+ into current_members_count
+ from rhnServerChannel sc,
+ rhnChannelFamilyMembers cfm,
+ rhnServer s
+ where s.org_id = org_id_in
+ and s.id = sc.server_id
+ and cfm.channel_family_id = channel_family_id_in
+ and cfm.channel_id = sc.channel_id
+ and exists (
+ select 1
+ from rhnChannelFamilyServerFve cfsp
+ where cfsp.CHANNEL_FAMILY_ID = channel_family_id_in
+ and cfsp.server_id = s.id
+ );
+
+ return current_members_count;
+ end;
PROCEDURE update_family_counts(channel_family_id_in IN NUMBER,
org_id_in IN NUMBER)
IS
BEGIN
- update rhnPrivateChannelFamily
- set current_members = (
- channel_family_current_members(channel_family_id_in, org_id_in)
- )
- where org_id = org_id_in
- and channel_family_id = channel_family_id_in;
-
+ update rhnPrivateChannelFamily
+ set current_members = ( channel_family_current_members(channel_family_id_in, org_id_in)),
+ fve_current_members = ( cfam_curr_fve_members(channel_family_id_in, org_id_in))
+ where org_id = org_id_in
+ and channel_family_id = channel_family_id_in;
END update_family_counts;
PROCEDURE update_group_family_counts(group_label_in IN VARCHAR2,
@@ -750,6 +849,20 @@ IS
channel_family_id_val, org_id_in);
END available_chan_subscriptions;
+ FUNCTION available_fve_chan_subs(channel_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ channel_family_id_val NUMBER;
+
+ BEGIN
+ SELECT channel_family_id INTO channel_family_id_val
+ FROM rhnChannelFamilyMembers
+ WHERE channel_id = channel_id_in;
+
+ RETURN rhn_channel.available_fve_family_subs( channel_family_id_val, org_id_in);
+ END available_fve_chan_subs;
+
-- *******************************************************************
-- PROCEDURE: entitle_customer
-- Creates a chan fam bucket, or sets max_members for an existing bucket
@@ -759,7 +872,8 @@ IS
-- *******************************************************************
procedure entitle_customer(customer_id_in in number,
channel_family_id_in in number,
- quantity_in in number)
+ quantity_in in number,
+ fve_quantity_in in number)
is
cursor permissions is
select 1
@@ -768,11 +882,13 @@ IS
and pcf.channel_family_id = channel_family_id_in;
begin
for perm in permissions loop
- set_family_maxmembers(
- customer_id_in,
- channel_family_id_in,
- quantity_in
- );
+ set_family_maxmembers(
+ customer_id_in,
+ channel_family_id_in,
+ quantity_in,
+ fve_quantity_in
+ );
+
rhn_channel.update_family_counts(
channel_family_id_in,
customer_id_in
@@ -781,9 +897,11 @@ IS
end loop;
insert into rhnPrivateChannelFamily pcf (
- channel_family_id, org_id, max_members, current_members
+ channel_family_id, org_id, max_members, current_members,
+ fve_max_members, fve_current_members
) values (
- channel_family_id_in, customer_id_in, quantity_in, 0
+ channel_family_id_in, customer_id_in, quantity_in, 0,
+ fve_quantity_in, 0
);
end;
@@ -796,31 +914,49 @@ IS
-- *******************************************************************
procedure set_family_maxmembers(customer_id_in in number,
channel_family_id_in in number,
- quantity_in in number)
+ quantity_in in number,
+ fve_quantity_in in number)
is
- cursor servers is
- select server_id from (
- select rownum row_number, server_id, modified from (
- select rcfsp.server_id,
- rcfsp.modified
- from rhnChannelFamilyServerPhysical rcfsp
- where rcfsp.customer_id = customer_id_in
- and rcfsp.channel_family_id = channel_family_id_in
- order by modified
- )
- where rownum > quantity_in
+ cursor phy_servers is
+ select server_id from (
+ select rownum row_number, server_id, modified from (
+ select rcfsp.server_id,
+ rcfsp.modified
+ from rhnChannelFamilyServerPhysical rcfsp
+ where rcfsp.customer_id = customer_id_in
+ and rcfsp.channel_family_id = channel_family_id_in
+ order by modified
+ )
+ where rownum > quantity_in
+ );
+ cursor fve_servers is
+ select server_id from (
+ select rownum row_number, server_id, modified from (
+ select rcfsp.server_id,
+ rcfsp.modified
+ from rhnChannelFamilyServerFve rcfsp
+ where rcfsp.customer_id = customer_id_in
+ and rcfsp.channel_family_id = channel_family_id_in
+ order by modified
+ )
+ where rownum > fve_quantity_in
);
begin
- -- prune subscribed servers
- for server in servers loop
- rhn_channel.unsubscribe_server_from_family(server.server_id,
+ for phy_server in phy_servers loop
+ rhn_channel.unsubscribe_server_from_family(phy_server.server_id,
+ channel_family_id_in);
+ end loop;
+
+ for fve_server in fve_servers loop
+ rhn_channel.unsubscribe_server_from_family(fve_server.server_id,
channel_family_id_in);
end loop;
- update rhnPrivateChannelFamily pcf
- set pcf.max_members = quantity_in
- where pcf.org_id = customer_id_in
- and pcf.channel_family_id = channel_family_id_in;
+ update rhnPrivateChannelFamily pcf
+ set pcf.max_members = quantity_in,
+ pcf.fve_max_members = fve_quantity_in
+ where pcf.org_id = customer_id_in
+ and pcf.channel_family_id = channel_family_id_in;
end;
procedure unsubscribe_server_from_family(server_id_in in number,
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pks b/schema/spacewalk/oracle/packages/rhn_channel.pks
index a6de86d..3e244c3 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pks
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pks
@@ -59,6 +59,7 @@ IS
server_id_in IN NUMBER,
family_id_in in number)
return number;
+ FUNCTION can_server_consume_fve( server_id_in IN NUMBER) RETURN NUMBER;
FUNCTION guess_server_base(server_id_in IN NUMBER) RETURN NUMBER;
@@ -96,9 +97,11 @@ IS
FUNCTION available_family_subscriptions(channel_family_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
- function channel_family_current_members(channel_family_id_in IN NUMBER,
- org_id_in IN NUMBER)
- return number;
+ FUNCTION available_fve_family_subs(channel_family_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
+
+ FUNCTION channel_family_current_members(channel_family_id_in IN NUMBER, org_id_in IN NUMBER) return number;
+
+ FUNCTION cfam_curr_fve_members(channel_family_id_in IN NUMBER, org_id_in IN NUMBER) return number;
PROCEDURE update_family_counts(channel_family_id_in IN NUMBER, org_id_in IN NUMBER);
PROCEDURE update_group_family_counts(group_label_in IN VARCHAR2, org_id_in IN NUMBER);
@@ -106,14 +109,25 @@ IS
FUNCTION available_chan_subscriptions(channel_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
- procedure entitle_customer(customer_id_in in number, channel_family_id_in in number, quantity_in in number);
- procedure set_family_maxmembers(customer_id_in in number, channel_family_id_in in number, quantity_in in number);
- procedure unsubscribe_server_from_family(server_id_in in number, channel_family_id_in in number);
+ FUNCTION available_fve_chan_subs(channel_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
- procedure delete_server_channels(server_id_in in number);
- procedure refresh_newest_package(channel_id_in in number, caller_in in varchar2 := '(unknown)');
-
- function get_org_id(channel_id_in in number) return number;
+ PROCEDURE entitle_customer(customer_id_in in number,
+ channel_family_id_in in number,
+ quantity_in in number,
+ fve_quantity_in in number);
+
+ PROCEDURE set_family_maxmembers(customer_id_in in number,
+ channel_family_id_in in number,
+ quantity_in in number,
+ fve_quantity_in in number);
+
+ PROCEDURE unsubscribe_server_from_family(server_id_in in number, channel_family_id_in in number);
+
+ PROCEDURE delete_server_channels(server_id_in in number);
+
+ PROCEDURE refresh_newest_package(channel_id_in in number, caller_in in varchar2 := '(unknown)');
+
+ FUNCTION get_org_id(channel_id_in in number) return number;
PRAGMA RESTRICT_REFERENCES(get_org_id, WNDS, RNPS, WNPS);
function get_org_access(channel_id_in in number, org_id_in in number) return number;
14 years
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit ee10f6731672b225976fdb70a5123f40f6d8cf89
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Jun 8 17:09:05 2010 +0200
591291 - associate packages also (when mergeing errata)
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
index f8072e2..92767ef 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
@@ -1844,7 +1844,14 @@ public class ChannelSoftwareHandler extends BaseHandler {
}
ErrataManager.publishErrataToChannel(toChannel, getErrataIds(diffErrata), user);
+ for (Errata errata : diffErrata) {
+ for (Iterator iter = errata.getPackages().iterator(); iter.hasNext();) {
+ Package pkg = (Package) iter.next();
+ toChannel.addPackage(pkg, user);
+ }
+ }
ChannelFactory.save(toChannel);
+ ChannelManager.refreshWithNewestPackages(toChannel, "api");
return diffErrata;
}
14 years
Changes to 'refs/tags/spacewalk-backend-1.1.20-1'
by Michael Mraka
Tag 'spacewalk-backend-1.1.20-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-06-08 14:51 +0000
Tagging package [spacewalk-backend] version [1.1.20-1] in directory [backend/].
Changes since spacewalk-backend-1.1.19-1:
Jan Hutar (3):
Just put space to the correct side
And one more space in 'sometime' as suggested by Jan Pazdziora
Also fixed 'Info' -> 'info' as suggested by Milan Zazrivec.
Justin Sherrill (1):
fixing issue where package summary could be null, causing NPE
Michael Mraka (11):
589524 - select packages, erratas and kickstart trees according to import date
let's move XML_DumperEx methods to NonAuthenticatedDumper as it's the only subclass
moved _send_headers(), send() and close() to NonAuthenticatedDumper
moved dump_channel_families(), dump_channels(), dump_channel_packages_short(), _packages(), dump_errata(), dump_kickstartable_trees() and dump_product_names() to NonAuthenticatedDumper
removed empty XML_DumperEx
fixed namespace in moved funcitions
superclass' __init__() is called by default
removed useless try-except
if we inherit from dumper.ChannelsDumper, we can even remove set_iterator()
_get_package_id() not used anywhere
Automatic commit of package [spacewalk-backend] release [1.1.20-1].
Milan Zazrivec (6):
600316 - don't traceback for zero subscribed channels
596237 - use constants in OSReleaseWindow & AlreadyRegisteredWindow
596237 - use constants in HardwareWindow
596237 - use constants in PackagesWindow
596237 - use constants in SendWindow
596237 - use constants in SendingWindow
Partha Aji (1):
529359: Fixed a couple of bugs related to Remote Command Package upgrade
Tomas Lestach (5):
fixing hashCode for Errata
591291 - clone errata instead of associating them to custom channels
601656 - fix channel permission check
601656 - fix channel permission check for channel.software.mergePackages
601656 - fix channel permission check for errata.clone
gguerrer (1):
l10n: Updates to Spanish (Castilian) (es) translation
ypoyarko (4):
l10n: Updates to Russian (ru) translation
l10n: Updates to Russian (ru) translation
l10n: Updates to Russian (ru) translation
l10n: Updates to Russian (ru) translation
---
backend/satellite_exporter/handlers/non_auth_dumper.py | 285 +
backend/satellite_tools/disk_dumper/dumper.py | 264 -
backend/satellite_tools/disk_dumper/iss.py | 40
backend/spacewalk-backend.spec | 6
client/rhel/rhn-client-tools/po/es.po | 194 -
client/rhel/rhn-client-tools/po/ru.po | 1922 +---------
client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 5
client/rhel/rhn-client-tools/src/up2date_client/rhnreg_constants.py | 49
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 50
client/tools/rhnpush/rhnpush.py | 2
java/code/src/com/redhat/rhn/domain/errata/AbstractErrata.java | 2
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/UpgradeConfirmSetupAction.java | 4
java/code/src/com/redhat/rhn/frontend/dto/PackageOverview.java | 4
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 16
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 2
java/code/src/com/redhat/rhn/frontend/struts/CommandForm.java | 44
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java | 108
java/code/src/com/redhat/rhn/frontend/xmlrpc/errata/ErrataHandler.java | 10
java/code/webapp/WEB-INF/struts-config.xml | 2
rel-eng/packages/spacewalk-backend | 2
20 files changed, 881 insertions(+), 2130 deletions(-)
---
14 years