c12s-kubespray/contrib/inventory_builder
Kenichi Omichi cc45e365ae
Fix print_hostnames of inventory.py (#8554)
When trying to run print_hostnames of inventory.py, it outputs the following
error:

 $ CONFIG_FILE=./test-hosts.yaml python3 ./inventory.py print_hostnames
 Traceback (most recent call last):
   File "./inventory.py", line 472, in <module>
     sys.exit(main())
   File "./inventory.py", line 467, in main
     KubesprayInventory(argv, CONFIG_FILE)
   File "./inventory.py", line 92, in __init__
     self.parse_command(changed_hosts[0], changed_hosts[1:])
   File "./inventory.py", line 415, in parse_command
     self.print_hostnames()
   File "./inventory.py", line 455, in print_hostnames
     print(' '.join(self.yaml_config['all']['hosts'].keys()))
 KeyError: 'all'

because it is missed to load a hosts config file before printing hostnames.
This fixes the issue.
2022-02-17 13:57:03 -08:00
..
tests Fix: adding new ips with inventory builder (#7577) (#7583) 2021-09-10 12:21:22 -07:00
inventory.py Fix print_hostnames of inventory.py (#8554) 2022-02-17 13:57:03 -08:00
requirements.txt Fix pep8 warnings (#4368) 2019-04-05 12:51:22 -07:00
setup.cfg renaming kargo-cli to kubespray-cli 2017-06-23 12:35:10 -04:00
setup.py Add inventory builder python script 2016-12-23 13:00:56 +03:00
test-requirements.txt Add inventory builder python script 2016-12-23 13:00:56 +03:00
tox.ini Fix Python code style for inventory_builder (#5362) 2019-12-05 01:48:32 -08:00