Error when enqueue-ref doesn't get long enough rev

The zuul executors (and the python git bindings they use) need full
length sha1 commit hashes. If you provide a short (or too long) hash
when attempting to enqueue a ref via the rpcclient the executors will
all fail and eventually you'll get a retry limit. We can avoid this
entirely if we error quickly and provide the user a nice error message.

Add a check for the old rev and new rev commit hash length. Additionally
check if the hash is a valid base 16 number. If not return a nice error
message.

Change-Id: Ia1cf4ac2bb87ce3248b34f246a6d6353df079dbf
2 files changed