Bug 863647 - NameError: global name 'disks_free' is not defined
NameError: global name 'disks_free' is not defined
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
18
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Chris Lumens
Fedora Extras Quality Assurance
abrt_hash:d17ab659ea19e03751e588aec56...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-06 05:47 EDT by Hicham HAOUARI
Modified: 2012-11-22 21:53 EST (History)
6 users (show)

See Also:
Fixed In Version: anaconda-18.17-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-22 21:53:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: anaconda-tb (150.92 KB, text/plain)
2012-10-06 05:47 EDT, Hicham HAOUARI
no flags Details
File: product (6 bytes, text/plain)
2012-10-06 05:47 EDT, Hicham HAOUARI
no flags Details
File: type (9 bytes, text/plain)
2012-10-06 05:47 EDT, Hicham HAOUARI
no flags Details
File: ifcfg.log (641 bytes, text/plain)
2012-10-06 05:47 EDT, Hicham HAOUARI
no flags Details
File: storage.log (37.14 KB, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: version (2 bytes, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: environ (761 bytes, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: anaconda.log (1.73 KB, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: syslog (66.05 KB, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: hashmarkername (8 bytes, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: packaging.log (1.20 KB, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: cmdline_file (87 bytes, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: release (24 bytes, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
File: program.log (17.59 KB, text/plain)
2012-10-06 05:48 EDT, Hicham HAOUARI
no flags Details
anaconda-tb-5013VJ (18.16, 2G crash) (255.63 KB, text/plain)
2012-10-12 23:33 EDT, Steve Tyler
no flags Details
anaconda-18.16-1/pylint-log (42.46 KB, text/plain)
2012-10-15 17:32 EDT, Steve Tyler
no flags Details

  None (edit)
Description Hicham HAOUARI 2012-10-06 05:47:41 EDT
Description of problem:
I tried to test fedora 18 boot.iso image from alt.fedoraproject.org generated on 05-Oct-2012, in kvm.
I tried all disk format and controllers ( disk is fully allocated at 10Gb). I always get this traceback when trying to do disk partitioning.


Version-Release number of selected component:
anaconda-18.12

Additional info:
libreport version: 2.0.14
cmdline:        /usr/bin/python  /sbin/anaconda
kernel:         3.6.0-0.rc6.git0.2.fc18.x86_64

description:
:The following was filed automatically by anaconda:
:anaconda 18.12 exception report
:Traceback (most recent call first):
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 233, in refresh
:    self._set_free_space_labels(disks_free, disk_free, fs_free)
:  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 571, in on_continue_clicked
:    dialog.refresh(required_space, disks_size, disk_free, fs_free, self.autopart)
:NameError: global name 'disks_free' is not defined
Comment 1 Hicham HAOUARI 2012-10-06 05:47:49 EDT
Created attachment 622657 [details]
File: anaconda-tb
Comment 2 Hicham HAOUARI 2012-10-06 05:47:51 EDT
Created attachment 622658 [details]
File: product
Comment 3 Hicham HAOUARI 2012-10-06 05:47:54 EDT
Created attachment 622659 [details]
File: type
Comment 4 Hicham HAOUARI 2012-10-06 05:47:57 EDT
Created attachment 622660 [details]
File: ifcfg.log
Comment 5 Hicham HAOUARI 2012-10-06 05:48:00 EDT
Created attachment 622661 [details]
File: storage.log
Comment 6 Hicham HAOUARI 2012-10-06 05:48:03 EDT
Created attachment 622662 [details]
File: version
Comment 7 Hicham HAOUARI 2012-10-06 05:48:05 EDT
Created attachment 622663 [details]
File: environ
Comment 8 Hicham HAOUARI 2012-10-06 05:48:11 EDT
Created attachment 622664 [details]
File: anaconda.log
Comment 9 Hicham HAOUARI 2012-10-06 05:48:24 EDT
Created attachment 622665 [details]
File: syslog
Comment 10 Hicham HAOUARI 2012-10-06 05:48:27 EDT
Created attachment 622666 [details]
File: hashmarkername
Comment 11 Hicham HAOUARI 2012-10-06 05:48:34 EDT
Created attachment 622667 [details]
File: packaging.log
Comment 12 Hicham HAOUARI 2012-10-06 05:48:43 EDT
Created attachment 622668 [details]
File: cmdline_file
Comment 13 Hicham HAOUARI 2012-10-06 05:48:47 EDT
Created attachment 622669 [details]
File: release
Comment 14 Hicham HAOUARI 2012-10-06 05:48:53 EDT
Created attachment 622670 [details]
File: program.log
Comment 15 Chris Lumens 2012-10-06 15:21:14 EDT
Are you still seeing this with anaconda-18.13-1?
Comment 16 Reartes Guillermo 2012-10-10 21:54:12 EDT
selected an 2gb usb mass storage device as a target. 

Package: anaconda-18.14
OS Release: Fedora release 18-Beta-TC3
Comment 17 Steve Tyler 2012-10-12 12:14:50 EDT
$ qemu-img create f18-test-4.img 1m

disc image is 1048576 bytes per 'ls -l'.


Package: anaconda-18.16-1.fc18.x86_64
OS Release: Fedora release 18
Comment 18 Steve Tyler 2012-10-12 14:37:32 EDT
$ qemu-img create f18-test-4.img 1G

Package: anaconda-18.16-1.fc18.x86_64
OS Release: Fedora release 18
Comment 19 Steve Tyler 2012-10-12 14:47:25 EDT
$ qemu-img create f18-test-4.img 2G

Package: anaconda-18.16-1.fc18.x86_64
OS Release: Fedora release 18
Comment 20 Steve Tyler 2012-10-12 15:13:02 EDT
There appears to be a disc image size between 2G and 4G where anaconda quits crashing with this exception:
NameError: global name 'disks_free' is not defined

anaconda-18.16-1.fc18.x86_64 does not crash with a 4G disc image.

Procedure:
1. $ qemu-img create f18-test-4.img 2G # 2G or less crashes
   NB: This creates an empty disc image with all zeroes.
2. $ qemu-kvm -m 2048 -hda f18-test-4.img -cdrom ~/xfr/fedora/F18/F18-Beta/TC3/Fedora-18-Beta-TC3-x86_64-Live-Desktop.iso -usb -vga qxl -boot menu=on -usbdevice mouse
3. Click "Installation Destination"
4. Click "Continue".

Results:
Crashes if disc image is less than or equal to 2G.
Does not crash if disc image is greater than or equal to 4G.
Comment 21 Steve Tyler 2012-10-12 15:24:23 EDT
(In reply to comment #20)
...
> Results:
> Crashes if disc image is less than or equal to 2G.
> Does not crash if disc image is greater than or equal to 4G.

anaconda-18.16-1.fc18.x86_64 does not crash at 3G. In summary:

1m  crash       (Comment 17)
1G  crash       (Comment 18)
2G  crash       (Comment 19)
3G  no crash    (this comment)
4G  no crash    (Comment 20)
Comment 22 Steve Tyler 2012-10-12 23:33:03 EDT
Created attachment 626404 [details]
anaconda-tb-5013VJ (18.16, 2G crash)

required_space: 2.68 GB
crash at 2, no crash at 3 ...
Is it significant that 2 < 2.68 < 3?

anaconda 18.16 exception report
Traceback (most recent call first):
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 269, in refresh
    self._set_free_space_labels(disks_free, disk_free, fs_free)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/ui/gui/spokes/storage.py", line 627, in on_continue_clicked
    dialog.refresh(required_space, disks_size, disk_free, fs_free, self.autopart)
NameError: global name 'disks_free' is not defined

Local variables in innermost frame:
autopart: True
self: <pyanaconda.ui.gui.spokes.storage.InstallOptions3Dialog object at 0x496bc10>
sw_text: Your current <b>Fedora</b> software selection requires <b>2.68 GB</b> of available space.
disk_free: 2.04 GB
label_text: Your current <b>Fedora</b> software selection requires <b>2.68 GB</b> of available space.
You don't have enough space available to install <b>Fedora</b>, even if you used all of the free space
available on the selected disks.
disks_size: 2.04 GB
fs_free: 0 b
required_space: 2.68 GB
Comment 23 Steve Tyler 2012-10-12 23:55:09 EDT
NameError: global name 'disks_free' is not defined

$ less -N ./anaconda-18.16-1/pyanaconda/ui/gui/spokes/storage.py

    153     def _set_free_space_labels(self, disks_size, disk_free, fs_free):
    237         self._set_free_space_labels(disks_size, disk_free, fs_free)

    257     def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
    269         self._set_free_space_labels(disks_free, disk_free, fs_free)
                                                  ^^^^

Maybe that should be 'disks_size' ?
Comment 24 Steve Tyler 2012-10-13 09:05:45 EDT
(In reply to comment #23)
> NameError: global name 'disks_free' is not defined
> 
> $ less -N ./anaconda-18.16-1/pyanaconda/ui/gui/spokes/storage.py
...
>     269         self._set_free_space_labels(disks_free, disk_free, fs_free)
... 
> Maybe that should be 'disks_size' ?

I made that change and got:
Bug 865849 - ValueError: ('invalid size specification', '0 b')

Next, I reverted the fix for:
Bug 859932 - Do not mix bits and bytes
https://lists.fedorahosted.org/pipermail/anaconda-patches/2012-October/001566.html

That seemed to work. An "Installation Options" dialog is displayed with a "you don't have enough space" warning.

Tested with:

anaconda-18.16-1
2GB disc image, zero-filled
$ qemu-kvm -m 2048 -hda f18-test-4.img -cdrom ~/xfr/fedora/F18/F18-Beta/TC3/Fedora-18-Beta-TC3-x86_64-Live-Desktop.iso -usb -vga qxl -boot menu=on -usbdevice mouse
Comment 25 Steve Tyler 2012-10-15 16:53:31 EDT
disks_free -> disks_size (#863647).
http://git.fedorahosted.org/cgit/anaconda.git/commit/?id=5def4f8063c27357c1ff16d128d97ee497e5e27a

Thanks.

pylint would have caught that:

$ grep disks_free pylint-log 
E0602:269,36:InstallOptions3Dialog.refresh: Undefined variable 'disks_free'

There are others in that log ...
Comment 26 Chris Lumens 2012-10-15 16:56:38 EDT
pylint is increasingly useless, given its inability to deal with gobject-introspection.
Comment 27 Steve Tyler 2012-10-15 17:32:06 EDT
Created attachment 627711 [details]
anaconda-18.16-1/pylint-log

OK. However, this one looks valid:

E0602:4046,12:BTRFSVolumeDevice.createSubVolumes: Undefined variable 'subvolume'

$ less -N anaconda-18.16-1/pyanaconda/storage/devices.py
...
   4041     def createSubVolumes(self):
   4042         self._do_temp_mount()
   4043         for name, subvol in self.subvolumes:
   4044             if subvol.exists:
   4045                 continue
   4046             subvolume.create(mountpoint=self._temp_dir_prefix)
   4047         self._undo_temp_mount()
...

The attachment is from running tests/pylint/runpylint.sh on anaconda-18.16-1.
Comment 28 Chris Lumens 2012-10-15 22:07:41 EDT
Please don't put more than one issue in the same bug.  It just makes it harder to tell what's been fixed and what's not.
Comment 29 Fedora Update System 2012-10-16 23:08:00 EDT
anaconda-18.17-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/anaconda-18.17-1.fc18
Comment 30 Fedora Update System 2012-10-17 13:29:11 EDT
Package anaconda-18.17-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-18.17-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16295/anaconda-18.17-1.fc18
then log in and leave karma (feedback).
Comment 31 Fedora Update System 2012-10-17 22:36:59 EDT
anaconda-18.18-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/anaconda-18.18-1.fc18
Comment 32 Fedora Update System 2012-10-18 11:28:58 EDT
Package anaconda-18.18-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-18.18-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16402/anaconda-18.18-1.fc18
then log in and leave karma (feedback).
Comment 33 Fedora Update System 2012-10-19 21:32:43 EDT
anaconda-18.19-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/anaconda-18.19-1.fc18
Comment 34 Steve Tyler 2012-11-05 17:01:41 EST
Attempting to reproduce Bug 865849 with:
F18-Beta-TC3
anaconda 18.16


Package: anaconda-18.16-1.fc18.x86_64
OS Release: Fedora release 18
Comment 35 Adam Williamson 2012-11-22 21:53:11 EST
This bug looks to have been fixed for many anaconda builds now but missed being closed. If you find you are still experiencing it with Fedora 18 Beta (RC1) or later, please re-open the bug.

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