Bug 519665

Summary: AttributeError: 'NoneType' object has no attribute 'dependsOn'
Product: [Fedora] Fedora Reporter: Alexander Todorov <atodorov>
Component: anacondaAssignee: David Cantrell <dcantrell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-23 19:32:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 520061    
Bug Blocks:    
Attachments:
Description Flags
anacdump.txt
none
updates.img
none
updates.tar.gz
none
anacdump.2 none

Description Alexander Todorov 2009-08-27 10:45:56 UTC
Created attachment 358841 [details]
anacdump.txt

Description of problem:
When using anaconda to install locally under some directory I get:

anaconda None exception report
Traceback (most recent call first):
  File "/usr/lib/anaconda/network.py", line 590, in write
    if rootdev.dependsOn(d) and isinstance(d,
  File "/usr/lib/anaconda/yuminstall.py", line 1467, in doPreInstall
    anaconda.id.network.write(instPath=anaconda.rootPath, anaconda=anaconda)
  File "/usr/lib/anaconda/backend.py", line 282, in doPreInstall
    anaconda.backend.doPreInstall(anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 205, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/anaconda/dispatch.py", line 128, in gotoNext
    self.moveStep()
  File "/usr/lib/anaconda/text.py", line 712, in run
    anaconda.dispatch.gotoNext()
  File "/usr/sbin/anaconda", line 965, in <module>
    anaconda.intf.run(anaconda)
AttributeError: 'NoneType' object has no attribute 'dependsOn'

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

How reproducible:
Always

Steps to Reproduce:
1. anaconda --text --rootpath=/mnt/nbdroot --method=http://fedora.nano-box.net/linux/releases/11/Fedora/i386/os/
2. where /mnt/nbdroot is empty, 5GB loopback mounted ext3 image which will serve as NBD root. 
3.
  
Actual results:
text mode starts, asks for some options and successfully retrieves package metadata. At the end of the progress bar when calculating dependencies the traceback happens.

Expected results:


Additional info:
anacdump.txt is attached.

Comment 1 David Cantrell 2009-08-27 23:06:34 UTC
I think I determined the cause of this problem.  In the rootDevice property of the FSSet object, we were not taking in to account the possibility of rootpath be overridden on the command line.

I have prepared a tar+gz file containing updates as well as an updates.img file, both for F-11.  Both contain the same fixes, but I'm not sure which will be easiest for you to try.

If you want to use updates.tar.gz, just unpack it in /usr/lib/anaconda on the system where you will be running the anaconda command from your opening comment.

If you want to use updates.img, just pass it to anaconda in any of the standard methods you would pass an updates image to anaconda.

If you could try the installation again in the same manner as you initially tried, but using the updates attached to this bug, I would like to know if the issue is solved or not.

Comment 2 David Cantrell 2009-08-27 23:07:00 UTC
Created attachment 358979 [details]
updates.img

Comment 3 David Cantrell 2009-08-27 23:07:21 UTC
Created attachment 358980 [details]
updates.tar.gz

Comment 4 Alexander Todorov 2009-08-28 07:52:14 UTC
Unpacking the tar.gz file in /usr/lib/anaconda and running the command from comment #0 gives:

Traceback (most recent call last):
  File "/usr/sbin/anaconda", line 549, in <module>
    from exception import handleException
  File "/usr/lib/anaconda/exception.py", line 41, in <module>
    import kickstart
  File "/usr/lib/anaconda/kickstart.py", line 21, in <module>
    from storage.deviceaction import *
  File "/usr/lib/anaconda/storage/__init__.py", line 1293, in <module>
    class FSSet(object):
  File "/usr/lib/anaconda/storage/__init__.py", line 1767, in FSSet
    def mkDevRoot(self, instPath=self.anaconda.rootPath):
NameError: name 'self' is not defined

instPath=self.anaconda.rootPath is causing the traceback. 

This patch applied to the updated storage/__init__.py fixes the new traceback.

--- __init__.py.orig    2009-08-28 03:41:06.077476093 -0400
+++ __init__.py 2009-08-28 03:48:39.025483722 -0400
@@ -1764,7 +1764,10 @@
         # nasty, nasty
         self.devicetree._addDevice(dev)
 
-    def mkDevRoot(self, instPath=self.anaconda.rootPath):
+    def mkDevRoot(self, instPath=None):
+        if instPath is None:
+            instPath = self.anaconda.rootPath
+
         root = self.rootDevice
         dev = "%s/%s" % (instPath, root.path)
         if not os.path.exists("%s/dev/root" %(instPath,)) and os.path.exists(dev):
@@ -1805,8 +1808,11 @@
 
         return migratable
 
-    def write(self, instPath=self.anaconda.rootPath):
+    def write(self, instPath=None):
         """ write out all config files based on the set of filesystems """
+        if instPath is None:
+            instPath = self.anaconda.rootPath
+
         # /etc/fstab
         fstab_path = os.path.normpath("%s/etc/fstab" % instPath)
         fstab = self.fstab()

Comment 5 Alexander Todorov 2009-08-28 07:55:01 UTC
Created attachment 359020 [details]
anacdump.2

I still get the same (I think) traceback even with patched anaconda.

Comment 6 Alexander Todorov 2009-08-28 08:29:26 UTC
Tested against rawhide but hit bug #520061

Comment 7 David Cantrell 2009-09-02 19:42:06 UTC
Patch for this issue will be in anaconda-12.20-1.  Moving to MODIFIED.  When you can test and verify, please move it to CLOSED RAWHIDE.  Will take a look at bug #520061.

Comment 8 Alexander Todorov 2009-09-07 14:13:03 UTC
Now I hit bug #521661.