]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
library/ceph_volume.py: remove six dependency
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 12 Jul 2019 14:19:48 +0000 (10:19 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 18 Jul 2019 13:57:28 +0000 (15:57 +0200)
The ceph nodes couldn't have the python six library installed which
could lead to error during the ceph_volume custom module execution.

  ImportError: No module named six

The six library isn't useful in this module if we're sure that all
action variables passed to the build_ceph_volume_cmd function are a
list and not a string.

Resolves: #4071

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
library/ceph_volume.py

index 9777c51bc7b6d15c33ed125f2627b58029e0e482..252f8419aaeeac27e0438dbe6d97234597947281 100644 (file)
@@ -3,7 +3,6 @@ import datetime
 import copy
 import json
 import os
-import six
 
 ANSIBLE_METADATA = {
     'metadata_version': '1.0',
@@ -217,7 +216,7 @@ def build_ceph_volume_cmd(action, container_image, cluster=None):
     if cluster:
         cmd.extend(['--cluster', cluster])
 
-    cmd.extend(action if not isinstance(action, six.string_types) else [action])
+    cmd.extend(action)
 
     return cmd
 
@@ -416,7 +415,7 @@ def list_storage_inventory(module, container_image):
     List storage inventory.
     '''
 
-    action = 'inventory'
+    action = ['inventory']
     cmd = build_ceph_volume_cmd(action, container_image)
     cmd.append('--format=json')