Getting all packages without channel
Packages to remove: 11484
Deleting packages from spacewalk (if packages could not be removed they are maybe in another channel too)
Deleting package docker-engine-1.11.2-1.el7.centos (ID: 179245)
- Could not delete package from Spacewalk
Traceback (most recent call last):
File "/root/spacewalk-scripts/spacewalk-remove-old-packages.py", line 218, in <module>
main()
File "/root/spacewalk-scripts/spacewalk-remove-old-packages.py", line 210, in main
if ret != 1:
UnboundLocalError: local variable 'ret' referenced before assignment
It happens when an "except" is triggered; "ret" is then apparently not assigned, but the "if ret != 1:" line is still executed. Since I guess it only makes sense to execute the "if" line when "ret" is assigned, I moved it into the "try" block.
Running the script I get:
It happens when an "except" is triggered; "ret" is then apparently not assigned, but the "if ret != 1:" line is still executed. Since I guess it only makes sense to execute the "if" line when "ret" is assigned, I moved it into the "try" block.
spacewalk-remove-old-packages.py.diff.txt