Changes to 'refs/tags/spacewalk-backend-1.2.47-1'
by Jan Pazdziora
Tag 'spacewalk-backend-1.2.47-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-10-29 20:13 +0000
Tagging package [spacewalk-backend] version [1.2.47-1] in directory [backend/].
Changes since spacewalk-java-1.2.78-1:
Jan Pazdziora (3):
Move the SQL munging messages to debug level 6, to be above the "Executing SQL" message level.
For Function in PostgreSQL, we have to not just execute, but also fetch the value to return.
Automatic commit of package [spacewalk-backend] release [1.2.47-1].
Miroslav Suchý (1):
require versions which can handle cache_only
---
backend/server/rhnSQL/driver_postgresql.py | 12 ++++++++----
backend/spacewalk-backend.spec | 8 +++++++-
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5 +++++
rel-eng/packages/spacewalk-backend | 2 +-
4 files changed, 21 insertions(+), 6 deletions(-)
---
12 years, 11 months
backend/spacewalk-backend.spec rel-eng/packages
by Jan Pazdziora
backend/spacewalk-backend.spec | 8 +++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit b35ea258d937bd83c03962fc97e23238229b3285
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Oct 29 22:13:08 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.2.47-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index dae6a69..2111679 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -11,7 +11,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2 and Python
-Version: 1.2.46
+Version: 1.2.47
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -669,6 +669,12 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Oct 29 2010 Jan Pazdziora 1.2.47-1
+- For Function in PostgreSQL, we have to not just execute, but also fetch the
+ value to return.
+- Move the SQL munging messages to debug level 6, to be above the "Executing
+ SQL" message level.
+
* Fri Oct 29 2010 Jan Pazdziora 1.2.46-1
- Removing select with rownum. It seems not that useful anyway.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 8c69a55..ecee188 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.2.46-1 backend/
+1.2.47-1 backend/
12 years, 11 months
2 commits - backend/server
by Jan Pazdziora
backend/server/rhnSQL/driver_postgresql.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 335f140534de31335727ceb9ed18ad8b405bf638
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Oct 29 21:17:06 2010 +0200
For Function in PostgreSQL, we have to not just execute, but also fetch the value to return.
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index 5f53b12..1e24c03 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -75,9 +75,12 @@ class Function(sql_base.Procedure):
i += 1
query = "SELECT %s(%s)" % (self.name, positional_args)
- # for now return just result (ret_type is ignored)
log_debug(2, query, args)
- return self.cursor.execute(query, args)
+ ret = self.cursor.execute(query, args)
+ if self.ret_type == None:
+ return ret
+ else:
+ return self.cursor.fetchone()[0]
class Procedure(Function):
@@ -92,6 +95,7 @@ class Procedure(Function):
def __init__(self, name, cursor):
Function.__init__(self, name, cursor, None)
+ self.ret_type = None
def __call__(self, *args):
result = Function.__call__(self, *args)
commit df7b535b0494b7a1fb7d2c2ff2486431dcedb240
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Oct 29 20:28:57 2010 +0200
Move the SQL munging messages to debug level 6, to be above the "Executing SQL" message level.
diff --git a/backend/server/rhnSQL/driver_postgresql.py b/backend/server/rhnSQL/driver_postgresql.py
index d707990..5f53b12 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -45,9 +45,9 @@ def convert_named_query_params(query):
where it was used.
- number of arguments found and replaced
"""
- log_debug(3, "Converting query for PostgreSQL: %s" % query)
+ log_debug(6, "Converting query for PostgreSQL: %s" % query)
new_query = re.sub(r'(\W):(\w+)', r'\1%(\2)s', query.replace('%', '%%'))
- log_debug(3, "New query: %s" % new_query)
+ log_debug(6, "New query: %s" % new_query)
return new_query
12 years, 11 months
client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 38961f681e8721589b7dacf84daf5ccc48fa8859
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 29 20:57:59 2010 +0200
require versions which can handle cache_only
this older relases does not understood cache_only parameter for actions
if we call them with cache_only, we will create traceback.
It is not possible to require new version directly, because user do not
need this packages and can (and usually really do) operate without them.
So I choose to use conflict to not allow user have new rhn-client-tools
and old package with action class.
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index ebbb264..619eaad 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -30,6 +30,11 @@ Requires: python-dmidecode
Requires: libxml2-python
Conflicts: up2date < 5.0.0
+Conflicts: yum-rhn-plugin < 1.1.4-1
+Conflicts: rhncfg < 5.9.23-1
+Conflicts: spacewalk-koan < 0.2.7-1
+Conflicts: rhn-kickstart < 5.4.3-1
+Conflicts: rhn-virtualization < 5.4.14-1
BuildRequires: python-devel
BuildRequires: gettext
12 years, 11 months
Changes to 'refs/tags/spacewalk-java-1.2.78-1'
by Miroslav Suchý
Tag 'spacewalk-java-1.2.78-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-10-29 17:40 +0000
Tagging package [spacewalk-java] version [1.2.78-1] in directory [java/].
Changes since spacecmd-1.2.1-1:
Miroslav Suchý (2):
removing unused imports
Automatic commit of package [spacewalk-java] release [1.2.78-1].
---
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 2 --
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
---
12 years, 11 months
2 commits - java/code java/spacewalk-java.spec rel-eng/packages
by Miroslav Suchý
java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 2 --
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 26089005abe9d55dde55394710c35b3473ddd081
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 29 19:40:46 2010 +0200
Automatic commit of package [spacewalk-java] release [1.2.78-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 71a6d91..d04157e 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.2.77
+Version: 1.2.78
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -358,6 +358,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Oct 29 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.2.78-1
+- removing unused imports
+
* Fri Oct 29 2010 Jan Pazdziora 1.2.77-1
- removed unused Spacewalk (Certificate Signing Key) <jmrodri(a)nc.rr.com> key
from keyring (michael.mraka(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 5bfdf6c..d87979e 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.2.77-1 java/
+1.2.78-1 java/
commit d3ad99a8fffc28f436caa78863f673ec96bf696b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Oct 29 19:39:50 2010 +0200
removing unused imports
addressing:
./code/src/com/redhat/rhn/manager/system/SystemManager.java:65:8: Unused import - com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException.
./code/src/com/redhat/rhn/manager/system/SystemManager.java:66:8: Unused import - com.redhat.rhn.frontend.xmlrpc.NotActivatedSatelliteException.
diff --git a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
index 8b9f31f..90f6eae 100644
--- a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java
@@ -62,8 +62,6 @@ import com.redhat.rhn.frontend.dto.kickstart.KickstartSessionDto;
import com.redhat.rhn.frontend.listview.ListControl;
import com.redhat.rhn.frontend.listview.PageControl;
import com.redhat.rhn.frontend.xmlrpc.InvalidProxyVersionException;
-import com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException;
-import com.redhat.rhn.frontend.xmlrpc.NotActivatedSatelliteException;
import com.redhat.rhn.frontend.xmlrpc.ProxySystemIsSatelliteException;
import com.redhat.rhn.manager.BaseManager;
import com.redhat.rhn.manager.action.ActionManager;
12 years, 11 months
Changes to 'refs/tags/spacecmd-1.2.1-1'
by aparsons
Tag 'spacecmd-1.2.1-1' created by Aron Parsons <aparsons(a)redhat.com> at 2010-10-29 16:11 +0000
Tagging package [spacecmd] version [1.2.1-1] in directory [spacecmd/].
Changes since spacewalk-config-1.2.4-1:
Aron Parsons (10):
spacecmd: exit the shell if the initial login attempt fails
spacecmd: simplify the logic to print the intro when starting the shell
spacecmd: print help messages for functions if the user passes --help
spacecmd: print the system ID and last checkin in report_duplicates
spacecmd: cleanup the warning message when trying to perform an aciton on a duplicate profile name
spacecmd: allow the user to pass system IDs to all functions (useful when there are duplicates)
spacecmd: remove old code that was checking for system IDs in system_delete
spacecmd: added help topics for time and system options
spacecmd: renamed system_addchildchannel to system_addchildchannels and system_removechildchannel to system_removechildchannels for consistency
Automatic commit of package [spacecmd] release [1.2.1-1].
---
rel-eng/packages/spacecmd | 2 -
spacecmd/spacecmd.spec | 10 ++++++
spacecmd/src/bin/spacecmd | 63 +++++++++++++++++++++----------------------
spacecmd/src/lib/misc.py | 51 ++++++++++++++++++++++++----------
spacecmd/src/lib/report.py | 62 +++++++++++++++++++++++++-----------------
spacecmd/src/lib/schedule.py | 10 +++---
spacecmd/src/lib/shell.py | 11 ++-----
spacecmd/src/lib/system.py | 41 ++++++++++-----------------
8 files changed, 140 insertions(+), 110 deletions(-)
---
12 years, 11 months
rel-eng/packages spacecmd/spacecmd.spec
by aparsons
rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit ccc2e0a0a4d59dccadf7560443535013a735fc97
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 12:11:17 2010 -0400
Automatic commit of package [spacecmd] release [1.2.1-1].
diff --git a/rel-eng/packages/spacecmd b/rel-eng/packages/spacecmd
index 209078c..03abb9a 100644
--- a/rel-eng/packages/spacecmd
+++ b/rel-eng/packages/spacecmd
@@ -1 +1 @@
-0.7.5-1 spacecmd/
+1.2.1-1 spacecmd/
diff --git a/spacecmd/spacecmd.spec b/spacecmd/spacecmd.spec
index 0c70ccf..92a88dc 100644
--- a/spacecmd/spacecmd.spec
+++ b/spacecmd/spacecmd.spec
@@ -4,7 +4,7 @@
%endif
Name: spacecmd
-Version: 0.7.5
+Version: 1.2.1
Release: 1%{?dist}
Summary: Command-line interface to Spacewalk and Satellite servers
@@ -57,6 +57,14 @@ touch %{buildroot}/%{python_sitelib}/spacecmd/__init__.py
%doc %{_mandir}/man1/spacecmd.1.gz
%changelog
+* Fri Oct 29 2010 Aron Parsons <aparsons(a)redhat.com> 1.2.1-1
+- renamed system_addchildchannel to system_addchildchannels and
+ system_removechildchannel to system_removechildchannels for consistency
+- added help topics for time and system options
+- print the system ID and last checkin in report_duplicates
+- print help messages for functions if the user passes --help
+- exit the shell if the initial login attempt fails
+- version bump to 1.2 to stay in sync with other Spacewalk packages
* Thu Oct 07 2010 Aron Parsons <aparsons(a)redhat.com> 0.7.5-1
- fix unhandled exception in activationkey_create
(aparsons(a)redhat.com)
12 years, 11 months
9 commits - spacecmd/src
by aparsons
spacecmd/src/bin/spacecmd | 63 +++++++++++++++++++++----------------------
spacecmd/src/lib/misc.py | 51 ++++++++++++++++++++++++----------
spacecmd/src/lib/report.py | 62 +++++++++++++++++++++++++-----------------
spacecmd/src/lib/schedule.py | 10 +++---
spacecmd/src/lib/shell.py | 11 ++-----
spacecmd/src/lib/system.py | 41 ++++++++++-----------------
6 files changed, 130 insertions(+), 108 deletions(-)
New commits:
commit 49bf762c4817621de16a904fe9353df06f38388a
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 12:06:18 2010 -0400
spacecmd: renamed system_addchildchannel to system_addchildchannels and system_removechildchannel to system_removechildchannels for consistency
diff --git a/spacecmd/src/lib/system.py b/spacecmd/src/lib/system.py
index d48792e..6797b3a 100644
--- a/spacecmd/src/lib/system.py
+++ b/spacecmd/src/lib/system.py
@@ -77,9 +77,9 @@ def manipulate_child_channels(self, args, remove=False):
if len(args) < 2:
if remove:
- self.help_system_removechildchannel()
+ self.help_system_removechildchannels()
else:
- self.help_system_addchildchannel()
+ self.help_system_addchildchannels()
return
# use the systems listed in the SSM
@@ -1786,13 +1786,13 @@ def do_system_listchildchannels(self, args):
####################
-def help_system_addchildchannel(self):
- print "system_addchildchannel: Add child channels to a system"
- print 'usage: system_addchildchannel <SYSTEMS> <CHANNEL ...>'
+def help_system_addchildchannels(self):
+ print "system_addchildchannels: Add child channels to a system"
+ print 'usage: system_addchildchannels <SYSTEMS> <CHANNEL ...>'
print
print self.HELP_SYSTEM_OPTS
-def complete_system_addchildchannel(self, text, line, beg, end):
+def complete_system_addchildchannels(self, text, line, beg, end):
parts = line.split(' ')
if len(parts) == 2:
@@ -1800,18 +1800,18 @@ def complete_system_addchildchannel(self, text, line, beg, end):
elif len(parts) > 2:
return tab_completer(self.list_child_channels(), text)
-def do_system_addchildchannel(self, args):
+def do_system_addchildchannels(self, args):
self.manipulate_child_channels(args)
####################
-def help_system_removechildchannel(self):
- print "system_removechildchannel: Remove child channels from a system"
- print 'usage: system_removechildchannel <SYSTEMS> <CHANNEL ...>'
+def help_system_removechildchannels(self):
+ print "system_removechildchannels: Remove child channels from a system"
+ print 'usage: system_removechildchannels <SYSTEMS> <CHANNEL ...>'
print
print self.HELP_SYSTEM_OPTS
-def complete_system_removechildchannel(self, text, line, beg, end):
+def complete_system_removechildchannels(self, text, line, beg, end):
parts = line.split(' ')
if len(parts) == 2:
@@ -1819,7 +1819,7 @@ def complete_system_removechildchannel(self, text, line, beg, end):
elif len(parts) > 2:
return tab_completer(self.list_child_channels(), text)
-def do_system_removechildchannel(self, args):
+def do_system_removechildchannels(self, args):
self.manipulate_child_channels(args, True)
####################
commit 87764c5e46dbf0ade7c22c4aa31f70fc020f9f9b
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 12:03:21 2010 -0400
spacecmd: added help topics for time and system options
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 22c1861..080a11f 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -33,7 +33,7 @@ group:GROUP
channel:CHANNEL
'''
-TIME_OPTS = '''Dates can be any of the following:
+HELP_TIME_OPTS = '''Dates can be any of the following:
Explicit Dates:
Dates can be expressed as explicit date strings in the YYYYMMDD[HHMM]
format. The year, month and day are required, while the hours and
@@ -76,6 +76,14 @@ SYSTEM_SEARCH_FIELDS = ['id', 'name', 'ip', 'hostname',
####################
+def help_systems(self):
+ print HELP_SYSTEM_OPTS
+
+def help_time(self):
+ print HELP_TIME_OPTS
+
+####################
+
def help_clear(self):
print 'clear: clear the screen'
print 'usage: clear'
diff --git a/spacecmd/src/lib/schedule.py b/spacecmd/src/lib/schedule.py
index efbbb94..00cc9b9 100644
--- a/spacecmd/src/lib/schedule.py
+++ b/spacecmd/src/lib/schedule.py
@@ -343,7 +343,7 @@ def help_schedule_listpending(self):
print 'schedule_listpending: List pending actions'
print 'usage: schedule_listpending [BEGINDATE] [ENDDATE]'
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def do_schedule_listpending(self, args):
return self.print_schedule_summary('pending', args)
@@ -354,7 +354,7 @@ def help_schedule_listcompleted(self):
print 'schedule_listcompleted: List completed actions'
print 'usage: schedule_listcompleted [BEGINDATE] [ENDDATE]'
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def do_schedule_listcompleted(self, args):
return self.print_schedule_summary('completed', args)
@@ -365,7 +365,7 @@ def help_schedule_listfailed(self):
print 'schedule_listfailed: List failed actions'
print 'usage: schedule_listfailed [BEGINDATE] [ENDDATE]'
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def do_schedule_listfailed(self, args):
return self.print_schedule_summary('failed', args)
@@ -376,7 +376,7 @@ def help_schedule_listarchived(self):
print 'schedule_listarchived: List archived actions'
print 'usage: schedule_listarchived [BEGINDATE] [ENDDATE]'
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def do_schedule_listarchived(self, args):
return self.print_schedule_summary('archived', args)
@@ -387,7 +387,7 @@ def help_schedule_list(self):
print 'schedule_list: List all actions'
print 'usage: schedule_list [BEGINDATE] [ENDDATE]'
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def do_schedule_list(self, args):
return self.print_schedule_summary('all', args)
diff --git a/spacecmd/src/lib/system.py b/spacecmd/src/lib/system.py
index c4c2c49..d48792e 100644
--- a/spacecmd/src/lib/system.py
+++ b/spacecmd/src/lib/system.py
@@ -283,7 +283,7 @@ options:
print
print self.HELP_SYSTEM_OPTS
print
- print self.TIME_OPTS
+ print self.HELP_TIME_OPTS
def complete_system_runscript(self, text, line, beg, end):
return self.tab_complete_systems(text)
commit 88b7aec78f87dd80fc99be73c56020d9652604b6
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 11:52:23 2010 -0400
spacecmd: remove old code that was checking for system IDs in system_delete
diff --git a/spacecmd/src/lib/system.py b/spacecmd/src/lib/system.py
index 462a8af..c4c2c49 100644
--- a/spacecmd/src/lib/system.py
+++ b/spacecmd/src/lib/system.py
@@ -1211,19 +1211,6 @@ def do_system_delete(self, args):
if re.match('ssm', args[0], re.I):
systems = self.ssm.keys()
else:
- # check for system IDs
- for item in args:
- try:
- system_id = int(item)
- system_ids.append(system_id)
- except ValueError:
- pass
-
- # don't try to expand IDs below
- for system_id in system_ids:
- if system_id in args:
- args.remove(system_id)
-
systems = self.expand_systems(args)
# get the system ID for each system
@@ -1239,6 +1226,8 @@ def do_system_delete(self, args):
# make the column the right size
colsize = max_length([ self.get_system_name(s) for s in system_ids ])
+ if colsize < 7: colsize = 7
+
print '%s System ID' % 'Profile'.ljust(colsize)
print '%s ---------' % ('-' * colsize)
commit 318c1acfdf905adb52a614df47beee92cd340330
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 11:47:17 2010 -0400
spacecmd: allow the user to pass system IDs to all functions (useful when there are duplicates)
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 7c10ea3..22c1861 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -689,6 +689,8 @@ def expand_systems(self, args):
args = args.split()
systems = []
+ system_ids = []
+
for item in args:
if re.match('ssm', item, re.I):
systems.extend(self.ssm)
@@ -715,12 +717,17 @@ def expand_systems(self, args):
else:
logging.warning('No systems subscribed to %s' % item)
else:
- # just a system name
- systems.append(item)
+ # translate system IDs that the user passes
+ try:
+ id = int(item)
+ system_ids.append(id)
+ except ValueError:
+ # just a system name
+ systems.append(item)
matches = filter_results(self.get_system_names(), systems)
- return matches
+ return matches + system_ids
def list_base_channels(self):
commit e5861a6cbe1a648e2982edccd42e567e79198c84
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 11:39:13 2010 -0400
spacecmd: cleanup the warning message when trying to perform an aciton on a duplicate profile name
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index 68cbef8..7c10ea3 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -643,10 +643,15 @@ def get_system_id(self, name):
logging.warning("Can't find system ID for %s" % name)
return 0
else:
- logging.warning('Multiple systems found with the same name')
+ logging.warning('Duplicate system profile names found')
+ logging.warning("You can delete duplicates with 'system_delete'")
+
+ id_list = '%s = ' % name
for id in systems:
- logging.warning('%s = %i' % (name, id))
+ id_list = id_list + '%i, ' % id
+
+ logging.warning(id_list[:-2])
return 0
commit 033c86b7fb15b195861d66562e64366f016d0d3b
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 11:28:43 2010 -0400
spacecmd: print the system ID and last checkin in report_duplicates
diff --git a/spacecmd/src/lib/report.py b/spacecmd/src/lib/report.py
index 361eaa2..fb5cb83 100644
--- a/spacecmd/src/lib/report.py
+++ b/spacecmd/src/lib/report.py
@@ -266,9 +266,20 @@ def do_report_duplicates(self, args):
if len(dupes_by_profile):
add_separator = True
- print 'Duplicate Profile Names'
- print '-----------------------'
- print '\n'.join(sorted(dupes_by_profile))
+ for item in dupes_by_profile:
+ print '%s:' % item
+
+ # get some details for each duplicate
+ systems = self.client.system.searchByName(self.session,
+ '^%s$' % item)
+
+ print 'System ID Last Checkin'
+ print '---------- -----------------'
+
+ for dupe in systems:
+ print '%i %s' % (dupe.get('id'), dupe.get('last_checkin'))
+
+ if len(dupes_by_profile) > 1: print
if self.check_api_version('10.11'):
dupes_by_ip = self.client.system.listDuplicatesByIp(self.session)
@@ -280,45 +291,48 @@ def do_report_duplicates(self, args):
if add_separator: print self.SEPARATOR
add_separator = True
- print 'Duplicate IP Addresses'
- print '----------------------'
-
for item in dupes_by_ip:
- print
print '%s:' % item.get('ip')
- for system in sorted(item.get('systems'),
- key=itemgetter('systemName')):
- print system.get('systemName')
+ print 'System ID Last Checkin'
+ print '---------- -----------------'
+
+ for dupe in item.get('systems'):
+ print '%i %s' % (dupe.get('systemId'),
+ dupe.get('last_checkin'))
+
+ if len(dupes_by_ip) > 1: print
if len(dupes_by_mac):
if add_separator: print self.SEPARATOR
add_separator = True
- print 'Duplicate MAC Addresses'
- print '-----------------------'
-
for item in dupes_by_mac:
- print
print '%s:' % item.get('mac').upper()
- for system in sorted(item.get('systems'),
- key=itemgetter('systemName')):
- print system.get('systemName')
+ print 'System ID Last Checkin'
+ print '---------- -----------------'
+
+ for dupe in item.get('systems'):
+ print '%i %s' % (dupe.get('systemId'),
+ dupe.get('last_checkin'))
+
+ if len(dupes_by_mac) > 1: print
if len(dupes_by_hostname):
if add_separator: print self.SEPARATOR
add_separator = True
- print 'Duplicate Hostnames'
- print '-------------------'
-
for item in dupes_by_hostname:
- print
print '%s:' % item.get('hostname')
- for system in sorted(item.get('systems'),
- key=itemgetter('systemName')):
- print system.get('systemName')
+ print 'System ID Last Checkin'
+ print '---------- -----------------'
+
+ for dupe in item.get('systems'):
+ print '%i %s' % (dupe.get('systemId'),
+ dupe.get('last_checkin'))
+
+ if len(dupes_by_hostname) > 1: print
# vim:ts=4:expandtab:
commit 0ca1958ee7bf6abd8aed5925d1c4cf07c8dfbb5f
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 10:44:14 2010 -0400
spacecmd: print help messages for functions if the user passes --help
diff --git a/spacecmd/src/lib/shell.py b/spacecmd/src/lib/shell.py
index 43503f3..2ccf4ad 100644
--- a/spacecmd/src/lib/shell.py
+++ b/spacecmd/src/lib/shell.py
@@ -128,6 +128,10 @@ class SpacewalkShell(Cmd):
else:
args = ''
+ # print the help message if the user passes '--help'
+ if re.search('--help', line):
+ return 'help %s' % command
+
# should we look for an item in the history?
if command[0] != '!' or len(command) < 2:
return line
commit c71de1ba513e4bc3eefa5371b215b7a259bbacfb
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 10:38:54 2010 -0400
spacecmd: simplify the logic to print the intro when starting the shell
diff --git a/spacecmd/src/bin/spacecmd b/spacecmd/src/bin/spacecmd
index 914421a..0f8d9cf 100755
--- a/spacecmd/src/bin/spacecmd
+++ b/spacecmd/src/bin/spacecmd
@@ -27,6 +27,13 @@ from optparse import Option, OptionParser
from pwd import getpwuid
from spacecmd.shell import SpacewalkShell
+_INTRO = '''Welcome to spacecmd, a command-line interface to Spacewalk.
+
+Type: 'help' for a list of commands
+ 'help <cmd>' for command-specific help
+ 'quit' to quit
+'''
+
if __name__ == '__main__':
optionsTable = [
Option('-u', '--username', action='store',
@@ -113,8 +120,8 @@ if __name__ == '__main__':
# create an instance of the shell
shell = SpacewalkShell(options)
+ # run a single command from the command line
if len(args):
- # run a single command from the command line
try:
# run the command
shell.onecmd(shell.precmd(' '.join(args)))
@@ -134,35 +141,33 @@ if __name__ == '__main__':
sys.exit(1)
else:
+ if not options.quiet:
+ print _INTRO
+
if not shell.do_login(''):
sys.exit(1)
# stay in the interactive shell forever
while True:
- # use try..finally to overcome 2.4's lack of try..except..finally
try:
- try:
- shell.cmdloop()
- except KeyboardInterrupt:
- print
- except SystemExit:
- sys.exit(0)
- except Exception, detail:
- # get the relevant part of a XML-RPC fault
- if isinstance(detail, xmlrpclib.Fault):
- detail = detail.faultString
-
- # the session expired
- if re.search('Could not find session', detail, re.I):
- shell.session = ''
-
- if options.debug:
- # print the traceback when debugging
- logging.exception(detail)
- else:
- logging.error(detail)
- finally:
- # don't print the intro again
- shell.intro = ''
+ shell.cmdloop()
+ except KeyboardInterrupt:
+ print
+ except SystemExit:
+ sys.exit(0)
+ except Exception, detail:
+ # get the relevant part of a XML-RPC fault
+ if isinstance(detail, xmlrpclib.Fault):
+ detail = detail.faultString
+
+ # the session expired
+ if re.search('Could not find session', detail, re.I):
+ shell.session = ''
+
+ if options.debug:
+ # print the traceback when debugging
+ logging.exception(detail)
+ else:
+ logging.error(detail)
# vim:ts=4:expandtab:
diff --git a/spacecmd/src/lib/shell.py b/spacecmd/src/lib/shell.py
index 73e655e..43503f3 100644
--- a/spacecmd/src/lib/shell.py
+++ b/spacecmd/src/lib/shell.py
@@ -40,13 +40,6 @@ class SpacewalkShell(Cmd):
# maximum length of history file
HISTORY_LENGTH = 1024
- intro = '''
-Welcome to spacecmd, a command-line interface to Spacewalk.
-
-Type: 'help' for a list of commands
- 'help <cmd>' for command-specific help
- 'quit' to quit
-'''
cmdqueue = []
completekey = 'tab'
stdout = sys.stdout
commit 86feb224d855093ddded8a8a0c9542ea925ad90d
Author: Aron Parsons <aparsons(a)redhat.com>
Date: Fri Oct 29 10:33:09 2010 -0400
spacecmd: exit the shell if the initial login attempt fails
diff --git a/spacecmd/src/bin/spacecmd b/spacecmd/src/bin/spacecmd
index e0f14f3..914421a 100755
--- a/spacecmd/src/bin/spacecmd
+++ b/spacecmd/src/bin/spacecmd
@@ -134,18 +134,14 @@ if __name__ == '__main__':
sys.exit(1)
else:
- need_login = True
+ if not shell.do_login(''):
+ sys.exit(1)
# stay in the interactive shell forever
while True:
# use try..finally to overcome 2.4's lack of try..except..finally
try:
try:
- # we need to be logged in for tab completion to work
- if need_login and not shell.session:
- need_login = False
- shell.do_login('')
-
shell.cmdloop()
except KeyboardInterrupt:
print
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index d364288..68cbef8 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -167,7 +167,7 @@ def do_login(self, args):
# logout before logging in again
if len(self.session):
logging.warning('You are already logged in')
- return
+ return True
if self.options.nossl:
proto = 'http'
@@ -187,7 +187,7 @@ def do_login(self, args):
server = self.options.server
else:
logging.warning('No server specified')
- return
+ return False
server_url = '%s://%s/rpc/api' % (proto, server)
@@ -213,7 +213,7 @@ def do_login(self, args):
% (self.api_version, self.MINIMUM_API_VERSION))
self.client = None
- return
+ return False
# store the session file in the server's own directory
session_file = os.path.join(self.conf_dir, server, 'session')
@@ -244,8 +244,7 @@ def do_login(self, args):
# check the cached credentials by doing an API call
if self.session:
try:
- logging.debug('Using cached credentials from %s' %
- session_file)
+ logging.debug('Using cached credentials from %s' % session_file)
self.client.user.listUsers(self.session)
except:
@@ -256,7 +255,7 @@ def do_login(self, args):
# attempt to login if we don't have a valid session yet
if not len(self.session):
if len(username):
- print 'Username: %s' % username
+ print 'Spacewalk Username: %s' % username
else:
if self.options.username:
username = self.options.username
@@ -265,7 +264,7 @@ def do_login(self, args):
# again, the user is prompted for the information
self.options.username = None
else:
- username = prompt_user('Username:', noblank = True)
+ username = prompt_user('Spacewalk Username:', noblank = True)
if self.options.password:
password = self.options.password
@@ -274,14 +273,14 @@ def do_login(self, args):
# again, the user is prompted for the information
self.options.password = None
else:
- password = getpass('Password: ')
+ password = getpass('Spacewalk Password: ')
# login to the server
try:
self.session = self.client.auth.login(username, password)
except:
logging.error('Invalid credentials')
- return
+ return False
try:
# make sure ~/.spacecmd/<server> exists
@@ -309,6 +308,8 @@ def do_login(self, args):
logging.info('Connected to %s as %s' % (server_url, username))
+ return True
+
####################
def help_logout(self):
12 years, 11 months
Changes to 'refs/tags/spacewalk-config-1.2.4-1'
by Jan Pazdziora
Tag 'spacewalk-config-1.2.4-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-10-29 15:49 +0000
Tagging package [spacewalk-config] version [1.2.4-1] in directory [spacewalk/config/].
Changes since spacewalk-java-1.2.77-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-config] release [1.2.4-1].
---
rel-eng/packages/spacewalk-config | 2 +-
spacewalk/config/spacewalk-config.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
---
12 years, 11 months