]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-volume: Add PYTHONIOENCODING env variable
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 1 Apr 2019 20:02:28 +0000 (16:02 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 2 Apr 2019 10:41:55 +0000 (12:41 +0200)
Since https://github.com/ceph/ceph/commit/77912c0 ceph-volume uses
stdout encoding based on LC_CTYPE and PYTHONIOENCODING environment
variables.
Thoses variables aren't set when using ansible.
Currently this commit breaks non containerized deployment on Ubuntu.

TASK [use ceph-volume to create bluestore osds] ********************
  cmd:
  - ceph-volume
  - --cluster
  - ceph
  - lvm
  - create
  - --bluestore
  - --data
  - /dev/sdb
  rc: 1
  stderr: |-
    Traceback (most recent call last):
    (...)
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in
    position 132: ordinal not in range(128)

Note that the task is failing on ansible side due to the stdout
decoding but the osd creation is successful.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-config/tasks/main.yml
roles/ceph-osd/tasks/scenarios/lvm-batch.yml
roles/ceph-osd/tasks/scenarios/lvm.yml

index 0fa3c833a02a3154a422537f77d2430fd031afe7..2d63cc35251066947b26da263bea67707080ecf9 100644 (file)
@@ -37,6 +37,7 @@
       CEPH_VOLUME_DEBUG: 1
       CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+      PYTHONIOENCODING: utf-8
     when:
       - devices | default([]) | length > 0
       - osd_scenario == 'lvm'
@@ -57,6 +58,7 @@
       CEPH_VOLUME_DEBUG: 1
       CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+      PYTHONIOENCODING: utf-8
     when:
       - devices | default([]) | length > 0
       - osd_scenario == 'lvm'
index eb010832032b8958ee17f6cd1a219a269c80e3c6..e1f1b304dec5f6a02c9e378fbbb89643d5c35b1b 100644 (file)
@@ -15,3 +15,4 @@
     CEPH_VOLUME_DEBUG: 1
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+    PYTHONIOENCODING: utf-8
index 07f5878409bade9b1b9daf82a95dadce7354133b..40dbe8f52b3d4aded719ee340d85bc5e084906e8 100644 (file)
@@ -18,5 +18,6 @@
     CEPH_VOLUME_DEBUG: 1
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
+    PYTHONIOENCODING: utf-8
   with_items: "{{ lvm_volumes }}"
   tags: prepare_osd
\ No newline at end of file