client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 17 -----------
1 file changed, 17 deletions(-)
New commits:
commit d2435df3d9926677983fda547214bad7cecde362
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 15:55:55 2010 +0200
The rhnreg.registerUser (new_user) call is not needed as rhnreg.registerSystem2 validates the login/password as well.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 6882c14..5240b4b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -511,23 +511,6 @@ class LoginPage:
self.fatalError(_("There was an error communicating with the registration server. The message was:\n") + e.errmsg)
return True # fatalError in firstboot will return to here
- # I don't know why we call registerUser when logging in an existing
- # user, but the code did this. There was a comment which might have been
- # referring to this which said "legacy cruft". Maybe some old sat needs
- # this?
- try:
- rhnreg.registerUser(username, password)
- log.log_me("Registered login info.")
- except up2dateErrors.CommunicationError, e:
- setArrowCursor()
- errorWindow(_("There was a problem logging in:\n%s") %
- e.errmsg)
- return True
- except:
- setArrowCursor()
- errorWindow(_("There was problem logging in."))
- return True
-
setArrowCursor()
return False
14 years
client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 407b677c6105d22e777fdb2ba555a59a4fc29e56
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 12:07:55 2010 +0200
Do not show the AlreadyRegisteredDialog if we came back to the StartPage via Back.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/gui.py b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
index cca68bd..b1393ab 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -115,6 +115,7 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
self.oemInfo = {}
self.productInfo = {}
self.showedActivateSubscriptionPage = False
+ self.already_registered_already_shown = False
self.druid = self.xml.get_widget("druid")
self.mainWin = self.xml.get_widget("mainWin")
@@ -182,11 +183,12 @@ class Gui(rhnregGui.StartPage, rhnregGui.ChooseServerPage, rhnregGui.LoginPage,
self.startPage.emit_stop_by_name("prepare")
self.mainWin.set_title(_("Registering for software updates"))
self.druid.set_buttons_sensitive(False, True, True, False)
- if rhnreg.registered():
+ if rhnreg.registered() and not self.already_registered_already_shown:
# Dialog constructor returns when dialog closes
dialog = rhnregGui.AlreadyRegisteredDialog()
if dialog.rc == 0:
sys.exit(0)
+ self.already_registered_already_shown = True
def onStartPageNext(self, page, dummy):
self.druid.set_buttons_sensitive(True, True, True, False)
14 years
client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 1 -
1 file changed, 1 deletion(-)
New commits:
commit 54573c69e4ef2e5d59aa7e4a4394ef33c8877565
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 11:49:47 2010 +0200
The socket is not used in rhnregGui, we should not import it here.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index d410006..6882c14 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -31,7 +31,6 @@ a module with a class that inherits FirstBootGuiWindow.)
"""
import urlparse
-import socket
import gtk
# Need to import gtk.glade to make this file work alone even though we always
# access it as gtk.glade. Not sure why. Maybe gtk's got weird hackish stuff
14 years
client/rhel
by Jan Pazdziora
client/rhel/rhn-client-tools/src/up2date_client/gui.py | 7 -------
1 file changed, 7 deletions(-)
New commits:
commit 4a43c3f851d797eaf73fe6220d332249dee9f656
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Mar 31 11:46:37 2010 +0200
Do not hide warnings, we should address them instead.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/gui.py b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
index dd7ee7b..cca68bd 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/gui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/gui.py
@@ -9,13 +9,6 @@
import os
import sys
-import warnings
-
-# well, not pretty, but we use the same code on different
-# versions of python, so to avoid special casing, just
-# turn off deprecation warnings to avoid offending delicate
-# users eyes #142750, #142589, etc
-warnings.filterwarnings("ignore", "",DeprecationWarning)
import gtk
import gtk.glade
14 years
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6bbcf3600562d3a7a3571a45a997a48cb7d90680
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Apr 1 11:42:35 2010 +0200
fixing taskomatic problem
Addressing:
ERROR com.redhat.rhn.taskomatic.task.ChannelRepodata - com.redhat.rhn.common.util.MethodNotFoundException: Could not find method called: setChecksumtype in class: com.redhat.rhn.frontend.dto.PackageDto with params: [type: java.lang.String, value: md5]
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
index 24eae39..c311ebf 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Task_queries.xml
@@ -556,7 +556,7 @@ FROM
p.build_time, p.path, p.package_size, p.payload_size,
p.copyright, p.vendor, p.build_host, p.header_start, p.header_end,
srpm.name as source_rpm, pg.name as package_group_name,
- cs.checksum, cs.checksum_type as checksumtype,
+ cs.checksum, cs.checksum_type as checksum_type,
prd.primary as primary_xml, prd.filelist as filelist_xml, prd.other as other_xml
FROM
rhnChannelPackage cp,
14 years
monitoring/rhnmd
by Miroslav Suchý
monitoring/rhnmd/rhnmd.spec | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 530c3fc44f609df129771a06de97bebaceb1faea
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Apr 1 10:56:29 2010 +0200
578738 - obsolete i386 package on x86_64 platform
this is not multi arch package, historicaly we released i386 even for x86_64
and now people get both and have both installed.
diff --git a/monitoring/rhnmd/rhnmd.spec b/monitoring/rhnmd/rhnmd.spec
index 957dc58..19b84b3 100644
--- a/monitoring/rhnmd/rhnmd.spec
+++ b/monitoring/rhnmd/rhnmd.spec
@@ -16,6 +16,9 @@ Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: openssh-server openssh
BuildRequires: pam-devel
+%ifarch x86_64
+Obsoletes: rhmd.i386
+%endif
%description
rhnmd enables secure ssh-based communication between the monitoring
14 years
Changes to 'refs/tags/spacewalk-utils-0.9.6-1'
by Miroslav Suchý
Tag 'spacewalk-utils-0.9.6-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-04-01 07:53 +0000
Tagging package [spacewalk-utils] version [0.9.6-1] in directory [utils/].
Changes since spacewalk-backend-0.9.18-1:
Miroslav Suchý (4):
add script for deleting inactive systems
add man page for delete-old-systems-interactive
allow to store password in file for other users than admin
Automatic commit of package [spacewalk-utils] release [0.9.6-1].
Partha Aji (3):
577224 - Fixed an issue where when cloning KS profiles variables were not getting copied
574594 - Fixed date based sorting issues on 4 User List pages.
577074 - Fix to remove invalid characters from a cobbler system record name
---
java/code/src/com/redhat/rhn/common/db/datasource/xml/User_queries.xml | 27 +
java/code/src/com/redhat/rhn/common/util/DynamicComparator.java | 8
java/code/src/com/redhat/rhn/frontend/dto/UserOverview.java | 18 +
java/code/src/com/redhat/rhn/manager/kickstart/KickstartCloneCommand.java | 8
java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java | 5
java/code/webapp/WEB-INF/pages/admin/users/activelist.jsp | 1
java/code/webapp/WEB-INF/pages/admin/users/disabledlist.jsp | 3
java/code/webapp/WEB-INF/pages/common/fragments/user/userlist_columns.jspf | 1
rel-eng/packages/spacewalk-utils | 2
utils/Makefile | 5
utils/delete-old-systems-interactive | 166 ++++++++++
utils/spacewalk-utils.spec | 5
12 files changed, 231 insertions(+), 18 deletions(-)
---
14 years
4 commits - rel-eng/packages utils/delete-old-systems-interactive utils/Makefile utils/spacewalk-utils.spec
by Miroslav Suchý
rel-eng/packages/spacewalk-utils | 2
utils/Makefile | 5 -
utils/delete-old-systems-interactive | 166 +++++++++++++++++++++++++++++++++++
utils/spacewalk-utils.spec | 5 -
4 files changed, 174 insertions(+), 4 deletions(-)
New commits:
commit 430f730f2861cd5543b8d621f4290e9cd578b53e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Apr 1 09:53:32 2010 +0200
Automatic commit of package [spacewalk-utils] release [0.9.6-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils
index c78bdbe..9a927c9 100644
--- a/rel-eng/packages/spacewalk-utils
+++ b/rel-eng/packages/spacewalk-utils
@@ -1 +1 @@
-0.9.5-1 utils/
+0.9.6-1 utils/
diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec
index 159b568..9a0b9fb 100644
--- a/utils/spacewalk-utils.spec
+++ b/utils/spacewalk-utils.spec
@@ -1,7 +1,7 @@
%define rhnroot %{_prefix}/share/rhn
Name: spacewalk-utils
-Version: 0.9.5
+Version: 0.9.6
Release: 1%{?dist}
Summary: Utilities that may be run against a Spacewalk server.
@@ -57,6 +57,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Apr 01 2010 Miroslav Suchý <msuchy(a)redhat.com> 0.9.6-1
+- add script delete-old-systems-interactive
+
* Tue Mar 16 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.5-1
- added repo urls and gpg keys to spacewalk-common-channel.ini
commit b97c3c5a84790cfd4ed00764db7e8822dfe2a3b2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Apr 1 09:47:50 2010 +0200
allow to store password in file for other users than admin
diff --git a/utils/delete-old-systems-interactive b/utils/delete-old-systems-interactive
index 7139c89..22920c2 100755
--- a/utils/delete-old-systems-interactive
+++ b/utils/delete-old-systems-interactive
@@ -9,12 +9,6 @@ use Frontier::Client;
my $idle_time;
my ($host, $username) = ( 'localhost', 'admin' );
my $passwd;
-my $passwdfile = "/etc/rhn/$username-password";
-open PASSWD, $passwdfile or die "Error reading password file [$passwdfile]: $!\n";
-$passwd = <PASSWD>;
-chomp $passwd;
-close PASSWD;
-
my $force;
Getopt::Long::GetOptions(
@@ -29,6 +23,14 @@ if (not defined $idle_time) {
die "Need --idle parameter\n";
}
+if (not defined $passwd) {
+ my $passwdfile = "/etc/rhn/$username-password";
+ open PASSWD, $passwdfile or die "Error reading password file [$passwdfile]: $!\n";
+ $passwd = <PASSWD>;
+ chomp $passwd;
+ close PASSWD;
+}
+
my ($t, $w) = ($idle_time =~ /^(\d+)(\D)$/);
if (not defined $w) {
commit 14778a668790b01c11a134ca1762153905bcd17d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Apr 1 09:38:42 2010 +0200
add man page for delete-old-systems-interactive
diff --git a/utils/Makefile b/utils/Makefile
index d89ed69..a493f1a 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -33,8 +33,9 @@ ifneq ($(DOCBOOK),)
# install man pages
all :: $(MANS)
pod2man --section=8 spacewalk-api spacewalk-api.8
+ pod2man --section=8 delete-old-systems-interactive delete-old-systems-interactive.8
install :: $(MANS) $(PREFIX)/$(MANDIR)
- $(INSTALL_DATA) $(MANS) spacewalk-api.8* $(PREFIX)/$(MANDIR)/man8
+ $(INSTALL_DATA) $(MANS) spacewalk-api.8* delete-old-systems-interactive.8 $(PREFIX)/$(MANDIR)/man8
install :: $(CONFIGS) $(PREFIX)/$(CONFDIR)
$(INSTALL_DATA) $(CONFIGS) $(PREFIX)/$(CONFDIR)
endif
diff --git a/utils/delete-old-systems-interactive b/utils/delete-old-systems-interactive
index 6c9439a..7139c89 100755
--- a/utils/delete-old-systems-interactive
+++ b/utils/delete-old-systems-interactive
@@ -99,3 +99,66 @@ if (not $client->call('system.delete_systems', $session, [map $_->{id}, @$system
} else {
print "All systems deleted\n";
}
+
+=pod
+
+=head1 NAME
+
+delete-old-systems-interactive - delete inactive systems from Spacewalk server.
+
+=head1 SYNOPSIS
+
+delete-old-systems-interactive [OPTIONS] --idle time_delta
+
+=head1 DESCRIPTION
+
+delete-old-systems-interactive - will use Spacewalk API to determine when each registred system checked in
+last time and optionaly will delete systems which have been inactive for time_delta.
+
+This script will list all registred systems and their last check in. And will if none system is idle more
+then time_delta, it will write summary:
+
+ Total systems [127], none idle
+
+If some systems are idle more then time_delta, you will get summary like:
+
+ Total systems [127], would delete [51]
+
+None system is deleted by default, unless you specify --force option.
+
+=head1 OPTIONS
+
+--idle time_delta
+ Search for system, which are inactive for more then time_delta.
+ If only number is specified, it is interpreted as days. You can use suffixes m (for minutes),
+ h (hours), d (days) and w (weeks). E.g. "--idle 10" and "--idle 10d" is the same and means
+ ten days, "--idle 2w" means two weeks.
+
+--host host
+ Hostname of you Spacewalk server. If not set, localhost is used by default.
+
+--username login
+ Your username. By default "admin".
+
+--password pass
+ Your password. If not specified on command line, then it is read from /etc/rhn/$username-password
+
+--force
+ If specified, then idle systems are deleted.
+
+=head1 EXAMPLES
+
+ delete-old-systems-interactive --server=spacewalk.com --idle 30d
+
+=head1 AUTHOR
+
+Miroslav Suchy <msuchy(a)redhat.com>,
+Jan Pazdziora <jpazdziora(a)redhat.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 2009 Red Hat, Inc.
+Released under GNU General Public License, version 2 (GPLv2).
+
+=cut
+
commit fb8ee30b9726a07c4dc5225819a045d54a87cc04
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Apr 1 09:13:12 2010 +0200
add script for deleting inactive systems
diff --git a/utils/Makefile b/utils/Makefile
index 821d310..d89ed69 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -8,7 +8,7 @@ SUBDIR = utils
FILES = __init__ systemSnapshot migrateSystemProfile
SCRIPTS = sw-system-snapshot migrate-system-profile spacewalk-api apply_errata \
- scr.cgi spacewalk-common-channels
+ scr.cgi spacewalk-common-channels delete-old-systems-interactive
CONFIGS = spacewalk-common-channels.ini
DOCBOOK = $(wildcard /usr/bin/docbook2man)
diff --git a/utils/delete-old-systems-interactive b/utils/delete-old-systems-interactive
new file mode 100755
index 0000000..6c9439a
--- /dev/null
+++ b/utils/delete-old-systems-interactive
@@ -0,0 +1,101 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings FATAL => 'all';
+
+use Getopt::Long ();
+use Frontier::Client;
+
+my $idle_time;
+my ($host, $username) = ( 'localhost', 'admin' );
+my $passwd;
+my $passwdfile = "/etc/rhn/$username-password";
+open PASSWD, $passwdfile or die "Error reading password file [$passwdfile]: $!\n";
+$passwd = <PASSWD>;
+chomp $passwd;
+close PASSWD;
+
+my $force;
+
+Getopt::Long::GetOptions(
+ 'idle=s' => \$idle_time,
+ 'host=s' => \$host,
+ 'username=s' => \$username,
+ 'password=s' => \$passwd,
+ 'force' => \$force,
+);
+
+if (not defined $idle_time) {
+ die "Need --idle parameter\n";
+}
+
+my ($t, $w) = ($idle_time =~ /^(\d+)(\D)$/);
+
+if (not defined $w) {
+ $t = $idle_time;
+ $w = 'd';
+}
+if ($w eq 'm') { $idle_time = $t * 60; }
+elsif ($w eq 'h') { $idle_time = $t * 60 * 60; }
+elsif ($w eq 'd') { $idle_time = $t * 60 * 60 * 24; }
+elsif ($w eq 'w') { $idle_time = $t * 60 * 60 * 24 * 7; }
+else {
+ die "Unknown idle parameter [$idle_time]\n";
+}
+
+my $not_before = time - $idle_time;
+my ($sec, $min, $h, $d, $m, $y) = gmtime($not_before);
+my $cutoff = sprintf '%04d%02d%02dT%02d:%02d:%02d',
+ $y + 1900,$m + 1, $d, $h, $min, $sec;
+print "Lookup on [$host] systems with last checkin before [$cutoff] GMT\n";
+
+my $client = new Frontier::Client(url => "http://$host/rpc/api", debug=>0);
+my $session = $client->call('auth.login', $username, $passwd)
+ or die "Failed to login to [$host]\n";
+
+my $systems = $client->call('system.list_user_systems', $session);
+$systems = [
+ sort { $a->{last_checkin} cmp $b->{last_checkin} }
+ map { if (ref $_->{last_checkin}) {
+ $_->{last_checkin} = $_->{last_checkin}->value
+ } else {
+ $_->{last_checkin} =~ s/-//g;
+ }; $_;} @$systems
+];
+
+my $delete = 0;
+my $total = @$systems;
+$cutoff =~ s/-//g;
+$cutoff =~ tr/T/ /;
+for (my $i = 0; $i < @$systems; $i++) {
+ my $sys = $systems->[$i];
+ my $sys_date = $sys->{last_checkin};
+ if (not $sys_date =~ / /) {
+ $sys_date .= ' 23:59:59';
+ }
+ print "System [$sys->{name}] id [$sys->{id}] last checking [$sys->{last_checkin}] ";
+ if ($sys_date lt $cutoff) {
+ print " -> delete";
+ $delete ++;
+ } else {
+ splice @$systems, $i, 1;
+ $i--;
+ }
+ print "\n";
+}
+if (not $delete ) {
+ print "Total systems [$total], none idle\n";
+ exit;
+}
+if (not $force) {
+ print "Total systems [$total], would delete [$delete]\n";
+ exit;
+}
+
+print "Total systems [$total], will delete [$delete]\n";
+
+if (not $client->call('system.delete_systems', $session, [map $_->{id}, @$systems ])) {
+ print "Error deleting system [sys->{id}]\n";
+} else {
+ print "All systems deleted\n";
+}
14 years