<div dir="ltr">Commit eff786033cf57aad3465770e2eefec8e9b816b57.  Thanks Trent.<br><div class="gmail_extra"><br><div>/aron</div>
<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Date: Thu, 7 Mar 2013 08:50:59 -0600<br>
From: Trent Johnson <<a href="mailto:tljohnsn@oreilly.com">tljohnsn@oreilly.com</a>><br>
To: <a href="mailto:spacewalk-list@redhat.com">spacewalk-list@redhat.com</a><br>
Subject: [Spacewalk-list] spacecmd configchannel_export fails with<br>
        directories<br>
Message-ID: <<a href="mailto:1067B3C8-EA2E-40AB-880F-2608A5FBD2B4@oreilly.com">1067B3C8-EA2E-40AB-880F-2608A5FBD2B4@oreilly.com</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
spacecmd configchannel_export fails when the channel contains a directory<br>
<br>
A patch below contains a fix.<br>
<br>
Thanks,<br>
Trent<br>
<br>
>From 99ab7b5bbd3bb19195bbf78b574e023cbac19d78 Mon Sep 17 00:00:00 2001<br>
From: tljohnsn <<a href="mailto:tljohnsn@oreilly.com">tljohnsn@oreilly.com</a>><br>
Date: Thu, 7 Mar 2013 08:39:05 -0600<br>
Subject: [PATCH] Fix to allow configchannel_export to export a directory<br>
<br>
---<br>
 spacecmd/src/lib/configchannel.py |   21 ++++++++++++---------<br>
 1 files changed, 12 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/spacecmd/src/lib/configchannel.py b/spacecmd/src/lib/configchannel.py<br>
index e8bf556..37f6b16 100644<br>
--- a/spacecmd/src/lib/configchannel.py<br>
+++ b/spacecmd/src/lib/configchannel.py<br>
@@ -861,16 +861,19 @@ def export_configchannel_getdetails(self, channel):<br>
             # i.e binary or non-xml encodable ascii files can be exported as<br>
             # base64 encoded<br>
             if not f.has_key('contents'):<br>
-                if not self.check_api_version('11.1'):<br>
-                    logging.warning("File %s could not be exported " % f['path'] +\<br>
-                                        "with this API version(needs base64 encoding)")<br>
+                if f['type'] == 'directory':<br>
+                    f['contents'] = ''<br>
                 else:<br>
-                    <a href="http://logging.info" target="_blank">logging.info</a>("File %s could not be exported as" % f['path'] +\<br>
-                                     " text...getting base64 encoded version")<br>
-                    b64f = self.client.configchannel.getEncodedFileRevision(\<br>
-                        self.session, channel, f['path'], f['revision'])<br>
-                    f['contents'] = b64f['contents']<br>
-                    f['contents_enc64'] = b64f['contents_enc64']<br>
+                    if not self.check_api_version('11.1'):<br>
+                        logging.warning("File %s could not be exported " % f['path'] +\<br>
+                                            "with this API version(needs base64 encoding)")<br>
+                    else:<br>
+                        <a href="http://logging.info" target="_blank">logging.info</a>("File %s could not be exported as" % f['path'] +\<br>
+                                         " text...getting base64 encoded version")<br>
+                        b64f = self.client.configchannel.getEncodedFileRevision(\<br>
+                            self.session, channel, f['path'], f['revision'])<br>
+                        f['contents'] = b64f['contents']<br>
+                        f['contents_enc64'] = b64f['contents_enc64']<br>
<br>
         for k in [ 'channel', 'revision', 'creation', 'modified', \<br>
                        'permissions_mode', 'binary', 'md5' ]:<br>
--<br>
1.7.1<br></blockquote></div></div></div>