Bug 1281775 - spacewalk-data-fsck should emit an error when there is totally wrong path instead of ValueError
spacewalk-data-fsck should emit an error when there is totally wrong path ins...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Other (Show other bugs)
570
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Gennadii Altukhov
Dimitar Yordanov
:
Depends On:
Blocks: sat580-low
  Show dependency treegraph
 
Reported: 2015-11-13 07:17 EST by Jan Hutař
Modified: 2017-06-21 08:10 EDT (History)
4 users (show)

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


Attachments (Terms of Use)

  None (edit)
Description Jan Hutař 2015-11-13 07:17:22 EST
Description of problem:
spacewalk-data-fsck should emit an error when there is totally wrong path instead of "ValueError: too many values to unpack"


Version-Release number of selected component (if applicable):
spacewalk-backend-tools-2.3.3-33.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. # spacewalk-sql -i
   rhnschema=# update rhnPackage set path = 'redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/enca-1.16-1.el6.x86_64.rpm' where id=16330;
2. # mkdir /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/
   # cp /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/enca-1.16-1.el6.x86_64.rpm /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/
3. # spacewalk-data-fsck -v --fix-file-path


Actual results:
# spacewalk-data-fsck -v --fix-file-path
Checking if packages from database are present on filesystem
Traceback (most recent call last):
  File "/usr/bin/spacewalk-data-fsck", line 321, in <module>
    exit_value += check_db_vs_disk(options)
  File "/usr/bin/spacewalk-data-fsck", line 102, in check_db_vs_disk
    report['restore'] +=  check_disk_nevrao(abs_path, row.copy(), True)
  File "/usr/bin/spacewalk-data-fsck", line 148, in check_disk_nevrao
    file['basename']) = row['path'].split('/')
ValueError: too many values to unpack


Expected results:
Just error message should be printed and the tool should go on


Additional info:
I understand that I have create the breakage manually (and I guess that change in the DB is not required at all), but this tool is supposed to deal with breakages AFAICT.
Comment 1 Jan Hutař 2015-11-13 07:18:04 EST
This was found when working on bug 1201007
Comment 2 Gennadii Altukhov 2016-01-21 04:41:27 EST
Taking...
Comment 3 Gennadii Altukhov 2016-01-21 08:40:04 EST
spacewalk.git:

81e1a9c3a4edde4e760cc6b866b762c782db1b18

changes to fix:
0) Added processing of ValueError exception

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