rel-eng/packages/spacecmd | 2 +-
spacecmd/spacecmd.spec | 5 ++++-
spacecmd/src/lib/configchannel.py | 38 ++++++++++++++++++++------------------
3 files changed, 25 insertions(+), 20 deletions(-)
New commits:
commit 009c0a9b612429fe39f3d4f3127117048316e2a6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 28 12:24:34 2013 +0100
Automatic commit of package [spacecmd] release [1.9.2-1].
diff --git a/rel-eng/packages/spacecmd b/rel-eng/packages/spacecmd
index 5c7eb1f..a7c85e0 100644
--- a/rel-eng/packages/spacecmd
+++ b/rel-eng/packages/spacecmd
@@ -1 +1 @@
-1.9.1-1 spacecmd/
+1.9.2-1 spacecmd/
diff --git a/spacecmd/spacecmd.spec b/spacecmd/spacecmd.spec
index 8a0fcb6..0ab4555 100644
--- a/spacecmd/spacecmd.spec
+++ b/spacecmd/spacecmd.spec
@@ -4,7 +4,7 @@
%endif
Name: spacecmd
-Version: 1.9.1
+Version: 1.9.2
Release: 1%{?dist}
Summary: Command-line interface to Spacewalk and Satellite servers
@@ -60,6 +60,9 @@ touch %{buildroot}/%{python_sitelib}/spacecmd/__init__.py
%doc %{_mandir}/man1/spacecmd.1.gz
%changelog
+* Thu Feb 28 2013 Michael Mraka <michael.mraka(a)redhat.com> 1.9.2-1
+- fixing broken export of configchannels with symlinks
+
* Mon Feb 18 2013 Tomas Lestach <tlestach(a)redhat.com> 1.9.1-1
- sort export_kickstart_getdetails right after fetching
- Bumping package versions for 1.9.
commit 451b46efbbe2870a12ff68a6bd83af9b685c143d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Feb 28 12:15:54 2013 +0100
fixing broken export of configchannels with symlinks
see
https://www.redhat.com/archives/spacewalk-devel/2013-February/msg00018.html
diff --git a/spacecmd/src/lib/configchannel.py b/spacecmd/src/lib/configchannel.py
index 36ea376..02fba9d 100644
--- a/spacecmd/src/lib/configchannel.py
+++ b/spacecmd/src/lib/configchannel.py
@@ -845,25 +845,7 @@ def export_configchannel_getdetails(self, channel):
# string "macro-start-delimiter" Y N
# string "macro-end-delimiter" Y N
for f in fileinfo:
- # If we're using a recent API version files exported with no contents
- # i.e binary or non-xml encodable ascii files can be exported as
- # base64 encoded
- if not f.has_key('contents'):
- if not self.check_api_version('11.1'):
- logging.warning("File %s could not be exported " %
f['path'] +\
- "with this API version(needs base64 encoding)")
- else:
- logging.info("File %s could not be exported as" %
f['path'] +\
- " text...getting base64 encoded version")
- b64f = self.client.configchannel.getEncodedFileRevision(\
- self.session, channel, f['path'], f['revision'])
- f['contents'] = b64f['contents']
- f['contents_enc64'] = b64f['contents_enc64']
- for k in [ 'channel', 'revision', 'creation',
'modified', \
- 'permissions_mode', 'binary', 'md5' ]:
- if f.has_key(k):
- del f[k]
if f['type'] == 'symlink':
for k in [ 'contents', 'owner', 'group',
'permissions', \
'macro-start-delimiter',
'macro-end-delimiter' ]:
@@ -874,6 +856,26 @@ def export_configchannel_getdetails(self, channel):
del f['target_path']
f['permissions'] = str(f['permissions'])
+ # If we're using a recent API version files exported with no contents
+ # i.e binary or non-xml encodable ascii files can be exported as
+ # base64 encoded
+ if not f.has_key('contents'):
+ if not self.check_api_version('11.1'):
+ logging.warning("File %s could not be exported " %
f['path'] +\
+ "with this API version(needs base64
encoding)")
+ else:
+ logging.info("File %s could not be exported as" %
f['path'] +\
+ " text...getting base64 encoded version")
+ b64f = self.client.configchannel.getEncodedFileRevision(\
+ self.session, channel, f['path'], f['revision'])
+ f['contents'] = b64f['contents']
+ f['contents_enc64'] = b64f['contents_enc64']
+
+ for k in [ 'channel', 'revision', 'creation',
'modified', \
+ 'permissions_mode', 'binary', 'md5' ]:
+ if f.has_key(k):
+ del f[k]
+
details['files'] = fileinfo
return details