Bug 1309006 - rhncfg-manager removes all directories in a path during rollback transaction
rhncfg-manager removes all directories in a path during rollback transaction
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Gennadii Altukhov
Red Hat Satellite QA List
Depends On:
Blocks: space27
  Show dependency treegraph
Reported: 2016-02-16 12:15 EST by Gennadii Altukhov
Modified: 2017-09-28 14:07 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-06-16 04:10:16 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gennadii Altukhov 2016-02-16 12:15:08 EST
Description of problem:
rhncfg-manager raises an exceptions while handling an exception during a configuration directory deployment.

Version-Release number of selected component:
Spacewalk server 2.4

How reproducible:
0) Have an installed Spacewalk 2.4
1) Create a configuration channel
2) In configuration channel chose 'Add Files' -> 'Create File', add a directory, owned by a user that would not be present on the system by default
3) Register a client system in the Spacewalk Server with 'Provisioning' Entitlement
4) On the client system install packages rhncfg*
5) and run:
rhncfg-manager download-channel --topdir=/tmp rmdir_test_channel

Actual results:
[root@test04-64 ~]# rhncfg-manager download-channel --topdir=/tmp rmdir_test_channel
Using server name test01-64.sysmgmt.lab.eng.rdu2.redhat.com
Username: admin
Traceback (most recent call last):
  File "/usr/bin/rhncfg-manager", line 46, in <module>
    sys.exit(Main().main() or 0)
  File "/usr/share/rhn/config_common/rhn_main.py", line 207, in main
  File "/usr/share/rhn/config_management/rhncfg_download_channel.py", line 52, in run
  File "/usr/share/rhn/config_common/deploy.py", line 65, in deploy_files
    try_rollback(dep_trans, "Error unable to deploy file, information on user '%s' could not be found" % e[0])
  File "/usr/share/rhn/config_common/deploy.py", line 81, in try_rollback
  File "/usr/share/rhn/config_common/transactions.py", line 272, in rollback
OSError: [Errno 39] Directory not empty: '/tmp'

Expected results:
do no try to remove directories which were not created by current transaction

Additional info:

There is another bug 1309003, which is similar to this one, but actually
there is a reason to do it separately.
Comment 1 Gennadii Altukhov 2016-02-25 07:03:23 EST
Comment 2 Gennadii Altukhov 2016-02-29 10:57:07 EST

Comment 3 Tomáš Kašpárek 2016-06-16 04:10:16 EDT
Spacewalk 2.5 was released.
Comment 4 Eric Herget 2017-09-28 14:07:37 EDT
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.

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