[PATCH 3/5] Restrict known_hooks to only sub-directories of hookdir
Kamil Paral
kparal at redhat.com
Tue Sep 21 20:05:44 UTC 2010
----- "James Laska" <jlaska at redhat.com> wrote:
> ---
> autoqa | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/autoqa b/autoqa
> index e6bd8c9..56aea8e 100755
> --- a/autoqa
> +++ b/autoqa
> @@ -181,7 +181,8 @@ if not os.path.isdir(conf['hookdir']):
> print "Can't find hooks in %s. Check your installation." %
> conf['hookdir']
> sys.exit(1)
> # known hooks = dirs in hookdir
> -known_hooks = [d for d in os.listdir(conf['hookdir'])]
> +# FIXME - would be nice to have some way to determine what makes a
> hook valid
What about creating /usr/share/autoqa/hooks and putting all hooks there?
That way we can be sure that just hooks are there and nothing else.
> +known_hooks = [d for d in os.listdir(conf['hookdir']) if
> os.path.isdir(os.path.join(conf['hookdir'], d))]
>
> # Set up the option parser
> parser = optparse.OptionParser(usage="%prog HOOKNAME [options] ...",
>
> --
> 1.7.2.3
More information about the autoqa-devel
mailing list