From 5c85640037febf93f909b10db3b55d74477724d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 11 Aug 2020 14:47:06 +0200 Subject: [PATCH] ceph: fix lint on python script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sébastien Han --- .../ceph/create-external-cluster-resources.py | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py b/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py index 76a78d623..efcb9b84e 100644 --- a/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py +++ b/cluster/examples/kubernetes/ceph/create-external-cluster-resources.py @@ -259,7 +259,8 @@ class RadosJSON: # if user has provided any of the # '--cephfs-filesystem-name' or '--cephfs-data-pool-name' arguments, # raise an exception as we are unable to verify the args - raise ExecutionFailureException("'fs ls' ceph call failed with error: {}".format(err_msg)) + raise ExecutionFailureException( + "'fs ls' ceph call failed with error: {}".format(err_msg)) matching_json_out = {} # if '--cephfs-filesystem-name' argument is provided, @@ -292,15 +293,16 @@ class RadosJSON: # if there is no matching fs exists, that means provided data_pool name is invalid if not matching_json_out: raise ExecutionFailureException( - "Provided data_pool name, {}, does not exists".format( - self._arg_parser.cephfs_data_pool_name)) + "Provided data_pool name, {}, does not exists".format( + self._arg_parser.cephfs_data_pool_name)) # c. if nothing is set and couldn't find a default, else: # just return silently return if matching_json_out: - self._arg_parser.cephfs_filesystem_name = str(matching_json_out['name']) + self._arg_parser.cephfs_filesystem_name = str( + matching_json_out['name']) if type(matching_json_out['data_pools']) == list: # if the user has already provided data-pool-name, @@ -309,11 +311,11 @@ class RadosJSON: # if the provided name is not matching with the one in the list if self._arg_parser.cephfs_data_pool_name not in matching_json_out['data_pools']: raise ExecutionFailureException( - "{}: '{}', {}: {}".format( - "Provided data-pool-name", - self._arg_parser.cephfs_data_pool_name, - "doesn't match from the data-pools' list", - [str(x) for x in matching_json_out['data_pools']])) + "{}: '{}', {}: {}".format( + "Provided data-pool-name", + self._arg_parser.cephfs_data_pool_name, + "doesn't match from the data-pools' list", + [str(x) for x in matching_json_out['data_pools']])) # if data_pool name is not provided, # then try to find a default data pool name else: @@ -496,25 +498,25 @@ class RadosJSON: # if 'CEPHFS_FS_NAME' exists, then only add 'cephfs' StorageClass if self.out_map['CEPHFS_FS_NAME']: json_out.append( - { - "name": "cephfs", - "kind": "StorageClass", - "data": { + { + "name": "cephfs", + "kind": "StorageClass", + "data": { "fsName": self.out_map['CEPHFS_FS_NAME'], "pool": self.out_map['CEPHFS_POOL_NAME'] - } - }) + } + }) # if 'RGW_ENDPOINT' exists, then only add 'ceph-rgw' StorageClass if self.out_map['RGW_ENDPOINT']: json_out.append( - { - "name": "ceph-rgw", - "kind": "StorageClass", - "data": { + { + "name": "ceph-rgw", + "kind": "StorageClass", + "data": { "endpoint": self.out_map['RGW_ENDPOINT'], "poolPrefix": self.out_map['RGW_POOL_PREFIX'] - } - }) + } + }) return json.dumps(json_out)+LINESEP def main(self):