Skip to content

Commit

Permalink
Client: Removing unused list-impls function: rucio#6279
Browse files Browse the repository at this point in the history
  • Loading branch information
voetberg committed Apr 15, 2024
1 parent 1d25540 commit aceb87a
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions bin/rucio
Expand Up @@ -20,7 +20,6 @@ import itertools
import logging
import math
import os
import re
import signal
import subprocess
import sys
Expand Down Expand Up @@ -49,7 +48,6 @@ from rucio.common.test_rucio_server import TestRucioServer
from rucio.common.utils import sizefmt, Color, detect_client_location, chunks, parse_did_filter_from_string, \
parse_did_filter_from_string_fe, extract_scope, setup_logger, StoreAndDeprecateWarningAction
from rucio.common.constants import ReplicaState
from rucio.rse.protocols.protocol import RSEProtocol

EXTRA_MODULES = import_extras(['argcomplete'])

Expand Down Expand Up @@ -868,44 +866,6 @@ def erase(args):
return SUCCESS


@exception_handler
def list_impls(args):
"""
%(prog)s list-impls
List protocol implementations.
"""

PROTOCOL_DIRECTORY = '/opt/rucio/lib/rucio/rse/protocols'

for filename in os.listdir(PROTOCOL_DIRECTORY):
if os.path.isdir(os.path.join(PROTOCOL_DIRECTORY, filename)) or filename in ["__init__.py", "cache.py", "http_cache.py", "dummy.py", "protocol.py"]:
continue
else:
filename = re.sub(r".py", r"", filename)
__import__("rucio.rse.protocols", fromlist=[filename])

impls = []

def get_subclasses(cls):
for subclass in cls.__subclasses__():
if (str(subclass)[28:-2]).endswith('Default'):
class_name = str(subclass)[28:-10]
else:
class_name = str(subclass)[28:-2]
impls.append([class_name, subclass.__doc__])
get_subclasses(subclass)

get_subclasses(RSEProtocol)
impls = sorted(impls)
table = []
for impl in impls:
table.append([impl[0], impl[1]])

print(tabulate(table, tablefmt=tablefmt, headers=['impl', 'DESCRIPTION']))
return SUCCESS


@exception_handler
def upload(args):
"""
Expand Down Expand Up @@ -2265,10 +2225,6 @@ You can filter by key/value, e.g.::
list_content_history_parser.set_defaults(function=list_content_history)
list_content_history_parser.add_argument(dest='dids', nargs='+', action='store', help='List of space separated data identifiers.')

# The list-impls command
list_impls_parser = subparsers.add_parser('list-impls', help='List all supported protocol implementations.')
list_impls_parser.set_defaults(function=list_impls)

# The upload subparser
upload_parser = subparsers.add_parser('upload', help='Upload method.')
upload_parser.set_defaults(function=upload)
Expand Down

0 comments on commit aceb87a

Please sign in to comment.