On Tue, 4 Mar 2014 20:47:47 -0800
"W. Trevor King" <[email protected]> wrote:
> On Sun, Mar 02, 2014 at 03:00:59PM -0800, Brian Dolbec wrote:
> > def set_snapcache_path(self):
> > + self.settings["snapshot_cache_path"] = \
> > + normpath(self.settings["snapshot_cache"] + "/" +
> > + self.settings["snapshot"])
> > if "SNAPCACHE" in self.settings:
> > - self.settings["snapshot_cache_path"] = \
> > - normpath(self.settings["snapshot_cache"] + "/" +
> > - self.settings["snapshot"])
>
> If we're getting snapshot_cache_path key errors, I think the solution
> is to protect those call sites with:
>
> if 'SNAPCACHE' in self.settings:
>
> blocks, not to define a snapcache-only setting for folks who are not
> using snapcaches. There are not particularly many snapshot_cache_path
> references in catalyst. Grepping through them, the following looks
> suspicious:
>
> catalyst/targets/generic_stage_target.py-215-
> self.mountmap["portdir"] = normpath("/".join([
> catalyst/targets/generic_stage_target.py:216:
> self.settings["snapshot_cache_path"],
> catalyst/targets/generic_stage_target.py-217-
> self.settings["repo_name"],
> catalyst/targets/generic_stage_target.py-218- ]))
> catalyst/targets/generic_stage_target.py-219- if "SNAPCACHE" not in
> self.settings:
>
> Everything else looks fine. So what should portdir be if SNAPCACHE
> isn't set?
>
> Cheers,
> Trevor
>
Yeah, that's where it was failing. I don't think it matters to be
honest. But I admit I haven't analyzed it thoroughly. I ran into this
one while trying to track down other problems. So I quick fixed it.
It's amazing the errors you find turning things off that are normally
on.
I'm open to a better alternative. I think the potential is there for
more of these types of errors which depend on options selected.
--
Brian Dolbec <dolsen>