Bug 867125

Summary: pylint: E0601:2716,35:FSSet.mountFilesystems: Using variable 'e' before assignment
Product: [Fedora] Fedora Reporter: Steve Tyler <stephent98>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: anaconda-maint-list, g.kaviyarasu, jonathan, redhat_bugzilla, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-18 06:51:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Steve Tyler 2012-10-16 20:05:39 UTC
Description of problem:
E0601:2716,35:FSSet.mountFilesystems: Using variable 'e' before assignment

$ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
...
   2713             try:
   2714                 device.setup()
   2715             except Exception as msg:
   2716                 if errorHandler.cb(e, device) == ERROR_RAISE:
   2717                     raise
   2718                 else:
   2719                     continue
...

************* Module pyanaconda.storage
E0602: 99,15:storageInitialize: Undefined variable 'anaconda'
E0602:220,12:turnOnFilesystems: Undefined variable 'shutil'
E0602:774,28:Storage.shouldClear: Undefined variable 'CLEARPART_TYPE_LIST'
E1101:795,12:Storage.recursiveRemove: Instance of 'Storage' has no 'destroyFormat' member
E0602:854,28:Storage.initializeDisk: Undefined variable 'storage'
E0601:2716,35:FSSet.mountFilesystems: Using variable 'e' before assignment

Version-Release number of selected component (if applicable):
anaconda-18.16-1

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Steve Tyler 2012-10-16 20:56:08 UTC
E0602:854,28:Storage.initializeDisk: Undefined variable 'storage'

$ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
...
    853                 # remove the magic partition
    854                 for part in storage.partitions:
    855                     if part.disk == disk and part.partedPartition.number == number:
...

Comment 2 Steve Tyler 2012-10-16 21:02:30 UTC
E0602:774,28:Storage.shouldClear: Undefined variable 'CLEARPART_TYPE_LIST'

$ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
...
    774         if clearPartType == CLEARPART_TYPE_LIST and \
    775            device.name not in clearPartDevices:
    776             return False
...

Comment 3 Steve Tyler 2012-10-16 21:07:21 UTC
E1101:795,12:Storage.recursiveRemove: Instance of 'Storage' has no 'destroyFormat' member

$ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
...
    794         if device.isDisk:
    795             self.destroyFormat(device)
    796         else:
    797             self.destroyDevice(device)

Comment 4 Steve Tyler 2012-10-16 21:13:34 UTC
E0602:220,12:turnOnFilesystems: Undefined variable 'shutil'

$ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
...
    218         if upgrade_migrate:
    219             # we should write out a new fstab with the migrated fstype
    220             shutil.copyfile("%s/etc/fstab" % ROOT_PATH,
    221                             "%s/etc/fstab.anaconda" % ROOT_PATH)
    222             storage.fsset.write()

Comment 5 Steve Tyler 2012-10-16 22:48:29 UTC
(In reply to comment #2)
> E0602:774,28:Storage.shouldClear: Undefined variable 'CLEARPART_TYPE_LIST'
> 
> $ less -N anaconda-18.16-1/pyanaconda/storage/__init__.py
> ...
>     774         if clearPartType == CLEARPART_TYPE_LIST and \
>     775            device.name not in clearPartDevices:
>     776             return False
> ...

False positive:
$ grep CLEARPART_TYPE_LIST pykickstart/constants.py
CLEARPART_TYPE_LIST = 3

$ diff -u tests/pylint/runpylint.sh tests/pylint/runpylint-1.sh
--- tests/pylint/runpylint.sh	2012-10-11 17:37:40.000000000 -0700
+++ tests/pylint/runpylint-1.sh	2012-10-16 15:35:37.261083229 -0700
@@ -88,8 +88,8 @@
       sys.path.insert(4, "pyanaconda/.libs"); \
       sys.path.insert(5, "pyanaconda/iw"); \
       sys.path.insert(6, "pyanaconda/textw"); \
-      sys.path.insert(7, "/usr/share/system-config-date"); \
-      sys.path.insert(8, "/usr/share/system-config-keyboard")' \
+      sys.path.insert(7, "pykickstart"); \
+      ' \
     -i y -r n --disable=C,R --rcfile=/dev/null \
     $DISABLED_WARN_OPTIONS \
     $DISABLED_ERR_OPTIONS \

Comment 6 Fedora Update System 2012-12-15 03:35:08 UTC
anaconda-18.37.3-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/anaconda-18.37.3-1.fc18

Comment 7 Fedora Update System 2012-12-15 21:13:45 UTC
Package anaconda-18.37.3-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.37.3-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-20461/anaconda-18.37.3-1.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-12-18 06:51:50 UTC
anaconda-18.37.3-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Chris Lumens 2012-12-18 15:25:18 UTC
*** Bug 888220 has been marked as a duplicate of this bug. ***