-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix print_hostnames of inventory.py #8554
Fix print_hostnames of inventory.py #8554
Conversation
Oops, need to update the corresponding test. /hold |
23b7759
to
033f228
Compare
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.
033f228
to
1092c30
Compare
/hold cancel |
Thanks for the fix @oomichi ! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cristicalin, oomichi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* master: Configure Etcd container_manager explicitly (kubernetes-sigs#8521) Fix print_hostnames of inventory.py (kubernetes-sigs#8554) Fix etcd_events not getting upgraded in upgrade-cluster.yml (kubernetes-sigs#8550) nerdctl: upgrade to 0.16.1 (kubernetes-sigs#8539) Allow pausing after upgrade but before uncordon (kubernetes-sigs#8530) [calico] upgrade release checksums (kubernetes-sigs#8544) Allow to specify a source address for metallb peerings, and target only some nodes using node selectors (kubernetes-sigs#8534) add support for Dual Stack node InternalIP (kubernetes-sigs#8542) terraform/gcp: Allow to change extra disk types (kubernetes-sigs#8524) add support for Calico IP6_AUTODETECTION_METHOD (kubernetes-sigs#8541) implement download mirrors support (kubernetes-sigs#8474) Fix: Error when creating subnets more than AZ (kubernetes-sigs#8516) feat(offline): Improve generate_list.sh to generate offline file list using ansible (kubernetes-sigs#8537) (kubernetes-sigs#8538) docs: Update offline-environment.md for containerd (kubernetes-sigs#8520) (kubernetes-sigs#8523) Change Cilium setting identity_allocation_mode to cilium_identity_allocation_mode (kubernetes-sigs#8519) Fix wrong port name in metallb.yml.j2 (kubernetes-sigs#8510)
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.
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.
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.
What type of PR is this?
/kind bug
What this PR does / why we need it:
When trying to run print_hostnames of inventory.py, it outputs the following error:
because it is missed to load a hosts config file before printing hostnames.
This fixes the issue.
Which issue(s) this PR fixes:
Fixes #8507
Does this PR introduce a user-facing change?: