def storage_add_data(args):
    ' Build the config file '
    content = {'apiVersion': 'kadalu-operator.storage/v1alpha1', 'kind': 'KadaluStorage', 'metadata': {'name': args.name}, 'spec': {'type': args.type, 'storage': []}}
    if args.external:
        (node, vol) = args.external.split(':')
        content['spec']['details'] = [{'gluster_host': node, 'gluster_volname': vol.strip('/')}]
        return content
    if args.device:
        for devdata in args.device:
            (node, dev) = devdata.split(':')
            content['spec']['storage'].append({'node': node, 'device': dev})
    if args.path:
        for pathdata in args.path:
            (node, path) = pathdata.split(':')
            content['spec']['storage'].append({'node': node, 'path': path})
    if args.pvc:
        for pvc in args.pvc:
            content['spec']['storage'].append({'pvc': pvc})
    if (args.type == 'Replica2'):
        (node, path) = args.tiebreaker.split(':')
        content['spec']['tiebreaker'] = {'node': node, 'path': path, 'port': 24007}
    return content
Build the config file
def storage_add_data(args):
    '  '
    content = {'apiVersion': 'kadalu-operator.storage/v1alpha1', 'kind': 'KadaluStorage', 'metadata': {'name': args.name}, 'spec': {'type': args.type, 'storage': []}}
    if args.external:
        (node, vol) = args.external.split(':')
        content['spec']['details'] = [{'gluster_host': node, 'gluster_volname': vol.strip('/')}]
        return content
    if args.device:
        for devdata in args.device:
            (node, dev) = devdata.split(':')
            content['spec']['storage'].append({'node': node, 'device': dev})
    if args.path:
        for pathdata in args.path:
            (node, path) = pathdata.split(':')
            content['spec']['storage'].append({'node': node, 'path': path})
    if args.pvc:
        for pvc in args.pvc:
            content['spec']['storage'].append({'pvc': pvc})
    if (args.type == 'Replica2'):
        (node, path) = args.tiebreaker.split(':')
        content['spec']['tiebreaker'] = {'node': node, 'path': path, 'port': 24007}
    return content