[PATCH] Add support for NFS as install source in TUI. (#971298)

Samantha N. Bueno sbueno+anaconda at redhat.com
Tue Jul 23 14:55:40 UTC 2013


On Tue, Jul 23, 2013 at 08:42:45AM +0200, Vratislav Podzimek wrote:
> On Mon, 2013-07-22 at 11:28 -0400, Samantha N. Bueno wrote:
> > Note: should go into rhel7-branch also.
> > 
> > Resolves: rhbz#971298
> > ---
> >  pyanaconda/ui/tui/spokes/source.py | 68 ++++++++++++++++++++++++++++++++++----
> >  1 file changed, 62 insertions(+), 6 deletions(-)
> > 
> > diff --git a/pyanaconda/ui/tui/spokes/source.py b/pyanaconda/ui/tui/spokes/source.py
> > index cd5f718..3714364 100644
> > --- a/pyanaconda/ui/tui/spokes/source.py
> > +++ b/pyanaconda/ui/tui/spokes/source.py
> > @@ -32,6 +32,7 @@ from pyanaconda.constants import THREAD_SOURCE_WATCHER, THREAD_SOFTWARE_WATCHER,
> >  from pyanaconda.constants import THREAD_PAYLOAD_MD, THREAD_STORAGE, THREAD_CHECK_SOFTWARE
> >  
> >  import re
> > +from .... import time
> As Brian already suggested, 'import time' would be better.

The timezone spoke is named time.py; without the path specification,
python will try and import from there.
Hm, now that I think about it, I suspect the GUI spoke was named
"datetime_spoke.py" to avoid the exact same problem since there is
already a "datetime" module provided by python-libs. ;)
In that event, how do you feel on renaming time.py ->time_spoke.py? It
would effectively require zero change to anything else in the code.
 
> >      def getRepoMetadata(self):
> >          """ Pull down yum repo metadata """
> > +        # unfortunately, this sleep is needed in order to prevent a tb
> > +        # anaconda needs to try and mount our nfs dir (if we're using nfs)
> > +        # before kicking off all of the yum crap
> > +        time.sleep(1)
> I just wonder -- will 1 second be enough in at least a majority of
> cases? From what I've seen, mounting NFS may take quite a long time.

Yeah; you and Brian both noted this. I initially added this since I was
hitting some issues that--looking back--I was misinterpreting.
Looking over the code though, I think Brian is right and this block can
be removed entirely--mounting the NFS repo itself is handled in
packaging/yumpayload.py.

> > +    def __init__(self, app, data, storage, payload, instclass, selection, errors):
> > +        EditTUISpoke.__init__(self, app, data, storage, payload, instclass)
> > +        self.selection = selection
> > +        self.args = self.data.method
> > +        self.errors = errors
> > +
> > +
> Two blank lines here ^^. Otherwise this looks good to me.

Fixed locally. Thank you!

Samantha


More information about the anaconda-patches mailing list