when testing encodings for ansible - windows hosts error occurs [venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:62: KeyError]
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ansible, python
- Lĩnh vực
- devops, infrastructure, testing-qa
Hướng nghiên cứu
Start with test_infra.py and trace the failure through testinfra/backend/ansible.py:get_encoding, backend/base.py, and utils/ansible_runner.py:run_module. Reproduce the encoding check against a Windows host and inspect the captured Ansible result. Done means the Windows encoding test no longer raises the reported KeyError or related failure.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
> result = host.ansible(
"win_shell",
f"Get-Content -Path '{file_path}' | Out-String",
check=False,
become=True,
become_user="vlan8user",
become_method="runas",
)
test_infra.py:20:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib/python3.12/site-packages/testinfra/modules/ansible.py:43: in wrapper
return func(self, *args, **kwargs)
venv/lib/python3.12/site-packages/testinfra/modules/ansible.py:110: in __call__
result = self._host.backend.run_ansible(
venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:72: in run_ansible
result = self.ansible_runner.run_module(
venv/lib/python3.12/site-packages/testinfra/utils/ansible_runner.py:411: in run_module
with open(fpath, "r", encoding=get_encoding()) as f:
venv/lib/python3.12/site-packages/testinfra/backend/ansible.py:70: in get_encoding
return self.encoding
venv/lib/python3.12/site-packages/testinfra/backend/base.py:303: in encoding
self._encoding = self.get_encoding()
venv/lib/python3.12/site-packages/testinfra/backend/base.py:283: in get_encoding
cmd = self.run(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <testinfra.backend.ansible.AnsibleBackend object at 0x7f0793cdf9e0>
command = "python3 -c 'import locale;print(locale.getpreferredencoding())'"
args = ('python3',), kwargs = {'encoding': None}
out = {'ansible_facts': {'discovered_interpreter_python': '/usr/bin/python3'}, 'changed': False, 'module_stderr': 'Exception...Operation: (:) [], RuntimeException\r\n + FullyQualifiedErrorId : BadExpression\r\n \r\n', 'module_stdout': '', ...}
def run(
```
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 360
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytest-dev/pytest-testinfra
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Có thể đã có người làm @pfuntner đã nhận 562 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
pytest-dev/pytest-testinfra#801 · 1 bình luận ·
-
Chroot backendĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
pytest-dev/pytest-testinfra#789 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
pytest-dev/pytest-testinfra#788 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pytest-dev/pytest-testinfra#784 ·
Tất cả issue của pytest-dev/pytest-testinfra
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
aws-samples/sample-per-model-bedrock#295 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
pyrevitlabs/pyRevit#3792 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
zephyrproject-rtos/reqmgmt#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
polarsource/polar#15580 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[开源推荐] Windows 系统维护工具箱,支持后台任务队列Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4011 ·