Bug 713072 - Debian rhn_check not working with "Remote Command"
Summary: Debian rhn_check not working with "Remote Command"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.4
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Marcelo Moreira de Mello
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-06-14 08:06 UTC by David Hrbáč
Modified: 2011-12-22 16:49 UTC (History)
2 users (show)

Fixed In Version: rhncfg_5.10.14_all.deb
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-22 16:49:44 UTC
Embargoed:


Attachments (Terms of Use)
Patch proposed (5.36 KB, patch)
2011-09-09 11:20 UTC, Marcelo Moreira de Mello
no flags Details | Diff

Description David Hrbáč 2011-06-14 08:06:23 UTC
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

Comment 1 Jan Pazdziora 2011-07-20 11:51:59 UTC
Aligning under space16.

Comment 2 Marcelo Moreira de Mello 2011-08-25 04:42:40 UTC
Taking...

Comment 3 Marcelo Moreira de Mello 2011-08-25 04:49:59 UTC
  Which Debian version are you running?

Comment 4 Marcelo Moreira de Mello 2011-08-25 05:16:43 UTC
 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.

Comment 5 Marcelo Moreira de Mello 2011-08-25 05:21:13 UTC
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

Comment 6 Šimon Lukašík 2011-08-25 10:00:06 UTC
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.

Comment 7 Marcelo Moreira de Mello 2011-08-27 05:01:27 UTC
 
  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

Comment 8 David Hrbáč 2011-08-31 09:05:00 UTC
(In reply to comment #3)
>   Which Debian version are you running?

simon:~# cat /etc/debian_version
6.0.2

Comment 9 Marcelo Moreira de Mello 2011-09-09 11:20:29 UTC
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

Comment 10 Šimon Lukašík 2011-09-14 13:46:34 UTC
spacewalk.git: from ab58bda9f93e3e9bbaba15a96855e4632ca8340b
               to 660912a70238f085bb485557570109cc9ea7e2c2

Comment 11 Šimon Lukašík 2011-09-14 13:48:19 UTC
According to the spacewalk-devel list, the package has made it's way to
our debian repository. Moving to ON_QA.

Comment 12 Marcelo Moreira de Mello 2011-09-14 15:37:04 UTC
  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!

Comment 13 Milan Zázrivec 2011-12-22 16:49:44 UTC
Spacewalk 1.6 has been released.


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