Steps to Reproduce: 1. create remote command 2. run rhn_check 3. Actual results: Summary: Run an arbitrary script scheduled by hrb33adm Details: This action will be executed after 06/14/11 10:02:00 AM CEST. This action's status is: Failed. The client picked up this action on 06/14/11 10:02:53 AM CEST. The client completed this action on 06/14/11 10:02:53 AM CEST. Client execution returned "Fatal error in Python code occured [[6]]" (code -1) Run as: root:root Timeout: 600 seconds #!/bin/sh if [ ! -d /tmp/hrb33-test ] then /bin/mkdir /tmp/hrb33-test fi Start Date: (unknown) End Date: (unknown) Return Code: 0 Raw Output: view/download raw script output Filtered Output: Expected results: Should run smoothly. Additional info: simon-test:~# rhn_check /usr/share/rhn/actions/script.py:25: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module. from popen2 import MAXFD /usr/share/rhn/config_common/utils.py:17: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha simon-test:~# ls -al /tmp/ total 132 drwxrwxrwt 5 root root 4096 Jun 14 09:40 . drwxr-xr-x 22 root root 4096 May 31 09:23 .. -rw-r--r-- 1 root root 108117 Jun 9 13:42 alumni1.sql drwxrwxrwt 2 root root 4096 Jun 9 11:51 .ICE-unix drwx------ 2 root root 4096 Jun 9 11:51 vmware-root drwxrwxrwt 2 root root 4096 Jun 9 11:51 .X11-unix
Aligning under space16.
Taking...
Which Debian version are you running?
Below some tests after commit 6c9624ab7ec3a9962030a755c86e0d1f3617d40b and 941e323c03bfc14711a4251860845b54ae3e1846 root@debian:~# cat /etc/debian_version 6.0.2 root@debian:~# python test.py subprocess OK hashlib OK root@debian:~# cat test.py try: from subprocess import MAXFD print "subprocess OK" except ImportError: from popen2 import MAXFD print "popen2 OK" try: import hashlib print "hashlib OK" except: import sha print "sha OK" Waiting info.
941e323c03bfc14711a4251860845b54ae3e1846 645795 - making script actions (within rhncfg) work with RHEL 4 by using popen2 if subprocess is not available 6c9624ab7ec3a9962030a755c86e0d1f3617d40b fixed DeprecationWarning: the sha module is deprecated; use the hashlib module instead
The Debian version of rhncfg-* package family needs to be rebased to the latest version from Fedora. The fix should lend in client/debian/rhncfg-* directory in the spacewalk.git.
Scratch from a test from rebasing rhncfg-* package to debian stheo $> git remote -v origin git://git.fedorahosted.org/spacewalk.git (fetch) origin git://git.fedorahosted.org/spacewalk.git (push) stheo $> tree rhncfg/ rhncfg/ └── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── pycompat └── rules 1 directory, 7 files root@debian:/tmp# dpkg -i rhncfg_5.10.14_all.deb (Reading database ... 34641 files and directories currently installed.) Preparing to replace rhncfg 5.10.14 (using rhncfg_5.10.14_all.deb) ... Unpacking replacement rhncfg ... Setting up rhncfg (5.10.14) ... Processing triggers for man-db ... root@debian:/tmp# root@debian:/tmp# root@debian:/tmp# root@debian:/tmp# root@debian:/tmp# dpkg -s rhncfg Package: rhncfg Status: install ok installed Priority: extra Section: python Installed-Size: 664 Maintainer: Marcelo Moreira de Mello <mmello> Architecture: all Version: 5.10.14 Provides: rhncfg Depends: python, python-rhnlib (>= 2.5.40), rhn-client-tools Recommends: apt-spacewalk Conffiles: /etc/sysconfig/rhn/clientCaps.d/script 9a1472fa138bd7494676ba9b6b42d21d /etc/sysconfig/rhn/clientCaps.d/configfiles 81a1844c5c03f775696ba88b8dc1fc7d /etc/sysconfig/rhn/rhncfg-client.conf 887ca309bcb489e30db03a226f0e7d67 /etc/sysconfig/rhn/rhncfg-manager.conf 157aa57f8a5336f831fac29c4fec0d2d Description: Red Hat Network Configuration Management Client is some tools which provides a interface used to communicate against configuration channels. Homepage: https://fedorahosted.org/spacewalk root@debian:/tmp# rhn-actions-control --enable-all root@debian:/tmp# rhn-actions-control --report deploy is enabled diff is enabled upload is enabled mtime_upload is enabled run is enabled root@debian:/tmp# rhn-actions-control --disable-all root@debian:/tmp# rhn-actions-control --report deploy is disabled diff is disabled upload is disabled mtime_upload is disabled run is disabled root@debian:/tmp# grep MAXFD -A1 -B1 /usr/share/rhn/actions/script.py try: from subprocess import MAXFD except ImportError: from popen2 import MAXFD root@debian:/tmp# grep "import hashlib" -B1 -9 /usr/share/rhn/config_common/utils.py try: import hashlib except ImportError: import sha class hashlib: @staticmethod def new(checksum): if checksum == 'sha1': return sha.new() else: raise ValueError, "Incompatible checksum type" Making more test before send patch for approval
(In reply to comment #3) > Which Debian version are you running? simon:~# cat /etc/debian_version 6.0.2
Created attachment 522307 [details] Patch proposed Hello, Patch sent to approval at spacewalk-devel maillist. Mail thread: https://www.redhat.com/archives/spacewalk-devel/2011-September/msg00011.html Cheers, Marcelo Moreira de Mello
spacewalk.git: from ab58bda9f93e3e9bbaba15a96855e4632ca8340b to 660912a70238f085bb485557570109cc9ea7e2c2
According to the spacewalk-devel list, the package has made it's way to our debian repository. Moving to ON_QA.
Thank you for commiting the patch. Per Miroslav Suchý mail at spacewalk-devel mailist, the new package is now available at http://miroslav.suchy.cz/spacewalk/debian Thank you guys!
Spacewalk 1.6 has been released.