From 5e273a9072a4ae8dfcc1b63a014e367cb2a925e9 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 12 Jul 2019 10:19:48 -0400 Subject: [PATCH] library/ceph_volume.py: remove six dependency 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 (cherry picked from commit a64a61429d04d25a71d6136d02b4ab4a58ebd880) --- library/ceph_volume.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/ceph_volume.py b/library/ceph_volume.py index 9777c51bc..252f8419a 100644 --- a/library/ceph_volume.py +++ b/library/ceph_volume.py @@ -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')