pre-upload: fix fallback hook loading with some configs

We set up some defaults at the end of _get_override_hooks, but these
only get added when the config has a [Hook Overrides] section.  Rework
the code so we always add the defaults.

BUG=None
TEST=CQ passes

Change-Id: If589e9f1ca881f262f1feb9f32efbf37e339a224
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/repohooks/+/2036671
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index d65946d..46380e7 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -1884,15 +1884,14 @@
   """
   SECTION = 'Hook Overrides'
   SECTION_OPTIONS = 'Hook Overrides Options'
-  if not config.has_section(SECTION):
-    return set(), set()
 
   valid_keys = set(_HOOK_FLAGS.keys())
   hooks = _HOOK_FLAGS.copy()
+  options = config.options(SECTION) if config.has_section(SECTION) else []
 
   enable_flags = []
   disable_flags = []
-  for flag in config.options(SECTION):
+  for flag in options:
     if flag not in valid_keys:
       raise ValueError('Error: unknown key "%s" in hook section of "%s"' %
                        (flag, _CONFIG_FILE))