Bug 1060746 - spacecmd fails with configchannel_import file
Summary: spacecmd fails with configchannel_import file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 2.1
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space21
TreeView+ depends on / blocked
 
Reported: 2014-02-03 13:54 UTC by Gregor Gruener
Modified: 2014-12-15 01:02 UTC (History)
1 user (show)

Fixed In Version: spacecmd-2.1.25-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-04 12:37:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Gregor Gruener 2014-02-03 13:54:40 UTC
Description of problem:
spacecmd fails with configchannel_import

Version-Release number of selected component (if applicable):
spacecmd-2.1.24-1.el6.noarch.rpm

How reproducible:
spacecmd --debug -- configchannel_import attached_file.json

Actual results:
Python traceback error


Expected results:
Import all files without any issues

Additional info:
With spacecmd Version "spacecmd-2.0.2-1.el6.noarch.rpm" its running without any problems. I think it has something to do with the commit "9b8bcda9bb508a1d8067877e0438f3e4a3cbc2cd".


#spacecmd --debug -- configchannel_import /var/www/html/pub/clone_releases/6_5.1_rhel-x86_64-server-6/export_cc/6_5.1_x86_64_ccs.json
DEBUG: : False
DEBUG: Read configuration from /root/.spacecmd/config
DEBUG: Loading configuration section [spacecmd]
DEBUG: Current Configuration: {'server': 'localhost'}
DEBUG: Configuration section [localhost] does not exist
DEBUG: Connecting to https://localhost/rpc/api
DEBUG: Server API Version = 13.0
DEBUG: Using cached credentials from /root/.spacecmd/localhost/session
DEBUG: Loading cache from /root/.spacecmd/localhost/ssm
DEBUG: : False
DEBUG: Loading cache from /root/.spacecmd/localhost/systems
DEBUG: Loading cache from /root/.spacecmd/localhost/errata
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_short
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_long
DEBUG: Loading cache from /root/.spacecmd/localhost/packages_by_id
INFO: Connected to https://localhost/rpc/api as admin
DEBUG: Passed filename do_configchannel_import /var/www/html/pub/clone_releases/6_5.1_rhel-x86_64-server-6/export_cc/6_5.1_x86_64_ccs.json
INFO: Importing config channel  6_5.1_x86_64_common
INFO: Found file /etc/at.allow for cc 6_5.1_x86_64_common
ERROR: translate() takes exactly one argument (2 given)
Traceback (most recent call last):
  File "/usr/bin/spacecmd", line 133, in <module>
    shell.print_result(shell.onecmd( precmd ), precmd)
  File "/usr/lib64/python2.6/cmd.py", line 219, in onecmd
    return func(arg)
  File "/usr/lib/python2.6/site-packages/spacecmd/configchannel.py", line 976, in do_configchannel_import
    if self.import_configchannel_fromdetails(ccdetails) != True:
  File "/usr/lib/python2.6/site-packages/spacecmd/configchannel.py", line 1029, in import_configchannel_fromdetails
    elif self.file_needs_b64_enc(filedetails['contents']):
  File "/usr/lib/python2.6/site-packages/spacecmd/utils.py", line 742, in file_needs_b64_enc
    return float(len(contents.translate(_null_trans, text_characters))) / len(contents) > 0.3
TypeError: translate() takes exactly one argument (2 given)

Comment 2 Milan Zázrivec 2014-02-21 15:47:09 UTC
spacewalk.git master: 6daf599d669ec8b2f835991f0e30ac341e7f1d41

Comment 3 Gregor Gruener 2014-02-21 16:51:04 UTC
Hi Milan,

thanks for your fix. I will check this new version on Monday and I will give you Feedback.

Cheers,
Gregor

Comment 4 Gregor Gruener 2014-02-24 12:40:41 UTC
Hi Milan,

I just want to say, that with spacecmd-2.1.25-1.el6.noarch this issue does not exist anymore.
Thank you

Comment 5 Matej Kollar 2014-03-04 13:08:31 UTC
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21

Comment 6 Matej Kollar 2014-03-04 13:09:08 UTC
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21


Note You need to log in before you can comment on or make changes to this bug.