#215 validate.py: Fix running without arguments
Merged 3 years ago by sgallagh. Opened 3 years ago by lsedlar.
releng/ lsedlar/fedora-module-defaults minor-fix  into  master

file modified
+1 -1
@@ -98,7 +98,7 @@ 

  def main():

      result = os.EX_OK

  

-     if sys.argv[1]:

+     if len(sys.argv) > 1 and sys.argv[1]:

          script_dir = os.path.abspath(sys.argv[1])

      else:

          script_dir = os.path.dirname(os.path.realpath(__file__))

When no arguments are provided, it would crash with a traceback.

Well, this is probably pointless. Jenkins is missing pipeline plugin and doesn't run the tests (and it wouldn't hit this case anyway).

The patch is correct, though. So I'll merge it.

Pull-Request has been merged by sgallagh

3 years ago