Skip to content

Commit

Permalink
remove redundant code block for local_connection
Browse files Browse the repository at this point in the history
  • Loading branch information
sparul93 committed Feb 22, 2024
1 parent 3907921 commit 061c302
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
8 changes: 1 addition & 7 deletions src/filepass/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
from .filepass import (
file_pass,
local_connection,
osfs_connection,
sftp_connection,
smb_connection,
)
from .filepass import file_pass, osfs_connection, sftp_connection, smb_connection
from .filepass_config import ConnectionDetails

__all__ = [
Expand Down
11 changes: 2 additions & 9 deletions src/filepass/filepass.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,8 @@ def smb_connection(logger, conn_details: ConnectionDetails):
return fs_conn


def local_connection(logger, conn_details: ConnectionDetails):
"""Establishes a connection to a directory on the local filesystem"""
logger.debug("local connection to {}".format(conn_details.dir))
fs_conn = fs.open_fs("{}".format(conn_details.dir))
return fs_conn


def osfs_connection(logger, conn_details: ConnectionDetails):
logger.debug("osfs dir: {}".format(conn_details.dir))
logger.debug("osfs/local connection to dir: {}".format(conn_details.dir))
fs_conn = fs.open_fs(conn_details.dir)
return fs_conn

Expand All @@ -83,7 +76,7 @@ def file_pass(
connection_functions = {
"sftp": sftp_connection,
"smb": smb_connection,
"local": local_connection,
"local": osfs_connection,
"osfs": osfs_connection,
}

Expand Down

0 comments on commit 061c302

Please sign in to comment.