Browse Source

Ensure python main function return values (#7860)

The main functions are wrapped by a sys.exit function which expects and
argument. The curent implementation isn't returning values in all cases.
This change ensures main functions return a value in all cases.
pull/7894/head
Victor Morales 3 years ago
committed by GitHub
parent
commit
c7d12cddec
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions
  1. 1
      contrib/inventory_builder/inventory.py
  2. 3
      scripts/download_hash.py

1
contrib/inventory_builder/inventory.py

@ -430,6 +430,7 @@ def main(argv=None):
if not argv:
argv = sys.argv[1:]
KubesprayInventory(argv, CONFIG_FILE)
return 0
if __name__ == "__main__":

3
scripts/download_hash.py

@ -56,8 +56,9 @@ def main(argv=None):
argv = sys.argv[1:]
if not argv:
usage()
sys.exit(1)
return 1
download_hash(argv)
return 0
if __name__ == "__main__":

Loading…
Cancel
Save