Skip to content

Commit d12a5ba

Browse files
author
Alexander Kreuzer
committed
Added option to run ADT calls over RFC
Main effort is to split Connection in sap/adt/core.py into ConnectionViaRFC and ConnectionViaHTTP.
1 parent f4c830a commit d12a5ba

43 files changed

Lines changed: 415 additions & 170 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/sapcli

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ def parse_command_line(argv):
7676
arg_parser.add_argument("--msserv", default=os.getenv("SAP_MSSERV"), help="Message server port")
7777
arg_parser.add_argument("--sysid", default=os.getenv("SAP_SYSID"), help="System ID (use if connecting via a "
7878
"message server")
79-
arg_parser.add_argument("--group", default=os.getenv("SAP_GROUP"), help="Group (use if connecting via a message "
80-
"server")
79+
arg_parser.add_argument(
80+
"--rfc_group", # name "group" is already in use
81+
default=os.getenv("SAP_GROUP"),
82+
help="Group (use if connecting via a message "
83+
"server")
8184
arg_parser.add_argument("--snc_qop", default=os.getenv("SNC_QOP"), help="SAP Secure Login Client QOP")
8285
arg_parser.add_argument("--snc_myname", default=os.getenv("SNC_MYNAME"), help="SAP Secure Login Client MyName")
8386
arg_parser.add_argument("--snc_partnername",
@@ -86,6 +89,16 @@ def parse_command_line(argv):
8689
help="SAP Secure Login Client library (e.g. "
8790
"/Applications/Secure Login Client.app/Contents/MacOS/lib/libsapcrypto.dylib")
8891

92+
arg_parser.add_argument(
93+
"--rest-over-rfc",
94+
action='store_true',
95+
dest="rest_over_rfc",
96+
default=os.getenv("SAP_REST_OVER_RFC")
97+
not in [None, 'n', 'no', 'false', 'off'],
98+
help=
99+
"Prefer doing rest call over SAP RFC client (to use SNC or if HTTP port is firewalled)"
100+
)
101+
89102
subparsers = arg_parser.add_subparsers()
90103
# pylint: disable=not-an-iterable
91104
for connection, cmd in sap.cli.get_commands():

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
requests>=2.20.0
22
pyodata==1.7.0
33
PyYAML==5.4.1
4+
5+
urllib3~=1.26.7

sap/adt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Base classes for ADT functionality modules"""
22

3-
from sap.adt.core import Connection # noqa: F401
3+
from sap.adt.core import ConnectionViaHTTP, ConnectionViaRFC, Connection # noqa: F401
44
from sap.adt.function import FunctionGroup, FunctionModule # noqa: F401
55
from sap.adt.objects import ADTObject, ADTObjectType, ADTCoreData, OrderedClassMembers # noqa: F401
66
from sap.adt.objects import Class, Interface, DataDefinition # noqa: F401

0 commit comments

Comments
 (0)