The exists() method uses os.stat() instead of os.lstat() and so doesn't
work for symlinks pointing to a non-existent path. A corresponding
lexists() method doesn't exist yet.
Signed-off-by: Nils Philippsen <nils@redhat.com>
This doesn't attempt to prefix the base directory if a supplied `target`
is an absolute path (for debugging).
Fixes: fedora-infrastructure#9000
Signed-off-by: Nils Philippsen <nils@redhat.com>
We are now setting up distgit (and possibily other things like
Fedora Hosted) to use a more elaborate system of update hooks.
This updates the checking script so it is capable of ensuring this set
up.
We have a gitolite/check_fedmsg_hooks role, which installs a script and
schedules it.
Turns out, this script does more than just checking the fedmsg hooks,
depending on the command-line arguments used when running it.
As such, it makes sense to separate it out into its own role, and make
the gitolite/check_fedmsg_hooks role (and any other one using the
script) depend on it.
For example, this script is used for Fedora Hosted (still in Puppet),
and will soon be used for a new distgit hook check.