rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 8 +++++++-
spacecmd/src/lib/misc.py | 2 +-
spacecmd/src/lib/schedule.py | 7 ++++++-
spacecmd/src/lib/softwarechannel.py | 23 +++++++++++++++++++++++
spacecmd/src/lib/utils.py | 5 +++--
6 files changed, 41 insertions(+), 6 deletions(-)
New commits:
commit 308d7120f452b69ed6789a8a44dda78d2ee2722a
Author: Aron Parsons <aronparsons(a)gmail.com>
Date: Mon Sep 23 22:25:49 2013 -0400
Automatic commit of package [spacecmd] release [2.1.8-1].
diff --git a/rel-eng/packages/spacecmd b/rel-eng/packages/spacecmd
index 0bd3b88..c6ca8c2 100644
--- a/rel-eng/packages/spacecmd
+++ b/rel-eng/packages/spacecmd
@@ -1 +1 @@
-2.1.7-1 spacecmd/
+2.1.8-1 spacecmd/
diff --git a/spacecmd/spacecmd.spec b/spacecmd/spacecmd.spec
index 47dab6b..c90b86e 100644
--- a/spacecmd/spacecmd.spec
+++ b/spacecmd/spacecmd.spec
@@ -4,7 +4,7 @@
%endif
Name: spacecmd
-Version: 2.1.7
+Version: 2.1.8
Release: 1%{?dist}
Summary: Command-line interface to Spacewalk and Satellite servers
@@ -64,6 +64,12 @@ touch %{buildroot}/%{python_sitelib}/spacecmd/__init__.py
%doc %{_mandir}/man1/spacecmd.1.gz
%changelog
+* Mon Sep 23 2013 Aron Parsons <aronparsons(a)gmail.com> 2.1.8-1
+- spacecmd: use a non-privileged API call to check session validity
+- spacecmd: handle base64-encoded output in schedule_getoutput
+- spacecmd: add softwarechannel_setsyncschedule function
+- spacecmd: make globbing optional in parse_arguments()
+
* Mon Sep 02 2013 Aron Parsons <aronparsons(a)gmail.com> 2.1.7-1
- spacecmd: try to use a cached session even if the username is passed on the
command line
commit 6b2b4cc972420439cfd3e2f5ca9c79cc03436e5d
Author: David Juran <djuran(a)redhat.com>
Date: Mon Sep 23 22:25:01 2013 -0400
spacecmd: use a non-privileged API call to check session validity
Signed-off-by: Aron Parsons <aronparsons(a)gmail.com>
diff --git a/spacecmd/src/lib/misc.py b/spacecmd/src/lib/misc.py
index e84b88a..dff6fb3 100644
--- a/spacecmd/src/lib/misc.py
+++ b/spacecmd/src/lib/misc.py
@@ -307,7 +307,7 @@ def do_login(self, args):
try:
logging.debug('Using cached credentials from %s' % session_file)
- self.client.user.listUsers(self.session)
+ self.client.api.getApiNamespaces(self.session)
except:
logging.warning('Cached credentials are invalid')
self.current_user = ''
commit 1f0896775c6e9651a99e91b062c0629e84e84f48
Author: David Juran <djuran(a)redhat.com>
Date: Mon Sep 23 22:14:31 2013 -0400
spacecmd: handle base64-encoded output in schedule_getoutput
Signed-off-by: Aron Parsons <aronparsons(a)gmail.com>
diff --git a/spacecmd/src/lib/schedule.py b/spacecmd/src/lib/schedule.py
index f193dd8..e05c528 100644
--- a/spacecmd/src/lib/schedule.py
+++ b/spacecmd/src/lib/schedule.py
@@ -20,6 +20,7 @@
# NOTE: the 'self' variable is an instance of SpacewalkShell
+import base64
from operator import itemgetter
from spacecmd.utils import *
@@ -316,7 +317,11 @@ def do_schedule_getoutput(self, args):
print
print 'Output'
print '------'
- print r.get('output')
+ if r.get('output_enc64'):
+ base64.b64decode(r.get('output'))
+ else:
+ print r.get('output').encode('UTF8')
+
else:
completed = self.client.schedule.listCompletedSystems(self.session,
action_id)
commit c9861e1e914601f114f6f37897c677f920bde578
Author: Aron Parsons <aronparsons(a)gmail.com>
Date: Fri Sep 13 19:07:50 2013 -0400
spacecmd: add softwarechannel_setsyncschedule function
diff --git a/spacecmd/src/lib/softwarechannel.py b/spacecmd/src/lib/softwarechannel.py
index e0b86d8..93f8867 100644
--- a/spacecmd/src/lib/softwarechannel.py
+++ b/spacecmd/src/lib/softwarechannel.py
@@ -1598,4 +1598,27 @@ def do_softwarechannel_syncrepos(self, args):
logging.debug('Syncing repos for %s' % channel)
self.client.channel.software.syncRepo(self.session, channel)
+####################
+
+def help_softwarechannel_setsyncschedule(self):
+ print 'softwarechannel_setsyncschedule: '
+ print 'Sets the repo sync schedule for a software channel'
+ print
+ print 'usage: softwarechannel_setsyncschedule <CHANNEL>
<SCHEDULE>'
+
+def complete_softwarechannel_setsyncschedule(self, text, line, beg, end):
+ return tab_completer(self.do_softwarechannel_list('', True), text)
+
+def do_softwarechannel_setsyncschedule(self, args):
+ (args, options) = parse_arguments(args, glob = False)
+
+ if not len(args) == 7:
+ self.help_softwarechannel_setsyncschedule()
+ return
+
+ channel = args[0]
+ schedule = ' '.join(args[1:])
+
+ self.client.channel.software.syncRepo(self.session, channel, schedule)
+
# vim:ts=4:expandtab:
commit ab26993dcf94cdf6b50352de66398a6d34b12502
Author: Aron Parsons <aronparsons(a)gmail.com>
Date: Fri Sep 13 19:07:21 2013 -0400
spacecmd: make globbing optional in parse_arguments()
diff --git a/spacecmd/src/lib/utils.py b/spacecmd/src/lib/utils.py
index a289cb2..8a45f69 100644
--- a/spacecmd/src/lib/utils.py
+++ b/spacecmd/src/lib/utils.py
@@ -38,12 +38,13 @@ except ImportError:
__EDITORS = ['vim', 'vi', 'nano', 'emacs']
-def parse_arguments(args, options = []):
+def parse_arguments(args, options = [], glob = True):
try:
parts = shlex.split(args)
# allow simple globbing
- parts = [re.sub('\*', '.*', a) for a in parts]
+ if glob:
+ parts = [re.sub('\*', '.*', a) for a in parts]
parser = SpacecmdOptionParser(option_list = options)
(opts, leftovers) = parser.parse_args(args = parts)
Show replies by date