Skip to content

Commit

Permalink
Added option to run ADT calls over RFC
Browse files Browse the repository at this point in the history
Main effort is to split Connection in sap/adt/core.py into ConnectionViaRFC and ConnectionViaHTTP.
  • Loading branch information
Alexander Kreuzer committed Apr 12, 2022
1 parent f4c830a commit 6ba6417
Show file tree
Hide file tree
Showing 43 changed files with 416 additions and 177 deletions.
17 changes: 15 additions & 2 deletions bin/sapcli
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,11 @@ def parse_command_line(argv):
arg_parser.add_argument("--msserv", default=os.getenv("SAP_MSSERV"), help="Message server port")
arg_parser.add_argument("--sysid", default=os.getenv("SAP_SYSID"), help="System ID (use if connecting via a "
"message server")
arg_parser.add_argument("--group", default=os.getenv("SAP_GROUP"), help="Group (use if connecting via a message "
"server")
arg_parser.add_argument(
"--rfc_group", # name "group" is already in use
default=os.getenv("SAP_GROUP"),
help="Group (use if connecting via a message "
"server")
arg_parser.add_argument("--snc_qop", default=os.getenv("SNC_QOP"), help="SAP Secure Login Client QOP")
arg_parser.add_argument("--snc_myname", default=os.getenv("SNC_MYNAME"), help="SAP Secure Login Client MyName")
arg_parser.add_argument("--snc_partnername",
Expand All @@ -86,6 +89,16 @@ def parse_command_line(argv):
help="SAP Secure Login Client library (e.g. "
"/Applications/Secure Login Client.app/Contents/MacOS/lib/libsapcrypto.dylib")

arg_parser.add_argument(
"--rest-over-rfc",
action='store_true',
dest="rest_over_rfc",
default=os.getenv("SAP_REST_OVER_RFC")
not in [None, 'n', 'no', 'false', 'off'],
help=
"Prefer doing rest call over SAP RFC client (to use SNC or if HTTP port is firewalled)"
)

subparsers = arg_parser.add_subparsers()
# pylint: disable=not-an-iterable
for connection, cmd in sap.cli.get_commands():
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
requests>=2.20.0
pyodata==1.7.0
PyYAML==5.4.1

urllib3~=1.26.7
2 changes: 1 addition & 1 deletion sap/adt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Base classes for ADT functionality modules"""

from sap.adt.core import Connection # noqa: F401
from sap.adt.core import ConnectionViaHTTP, ConnectionViaRFC, Connection # noqa: F401
from sap.adt.function import FunctionGroup, FunctionModule # noqa: F401
from sap.adt.objects import ADTObject, ADTObjectType, ADTCoreData, OrderedClassMembers # noqa: F401
from sap.adt.objects import Class, Interface, DataDefinition # noqa: F401
Expand Down
Loading

0 comments on commit 6ba6417

Please sign in to comment.