summaryrefslogtreecommitdiff
path: root/python/enterprise.py
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2023-03-10 13:07:19 -0500
committerAlexander Taylor <alex@vector35.com>2023-03-10 13:07:19 -0500
commit63283aaad06d4d635b2ec19d82bd2da1a1fc6d14 (patch)
tree950ba7528aad0762beced32c0178f09c5befac6b /python/enterprise.py
parentaf85e10d20aa97cbd2e2c68bc7741cc5bc810c36 (diff)
Forgot to rename the Python API as well.
Diffstat (limited to 'python/enterprise.py')
-rw-r--r--python/enterprise.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/python/enterprise.py b/python/enterprise.py
index 547a2392..c0eb4830 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -11,6 +11,7 @@ import binaryninja._binaryninjacore as core
import binaryninja
from . import decorators
+from . import deprecation
if core.BNGetProduct() != "Binary Ninja Enterprise Client":
# None of these functions exist on other builds, so just raise here to notify anyone who tries to use this
@@ -221,8 +222,23 @@ def reservation_time_limit() -> int:
return core.BNGetEnterpriseServerReservationTimeLimit()
+def update_license(duration, _cache=True):
+ """
+ Acquire or refresh a floating license from the Enterprise server.
+
+ .. note:: You must authenticate with the Enterprise server before calling this.
+
+ :param int duration: Desired length of license checkout, in seconds.
+ :param bool _cache: Deprecated but left in for compatibility
+ """
+ if not core.BNUpdateEnterpriseServerLicense(duration):
+ raise RuntimeError(last_error())
+
+@deprecation.deprecated(details="Use .update_license instead.")
def acquire_license(duration, _cache=True):
"""
+ Function deprecated. Use update_license instead.
+
Check out and activate a license from the Enterprise Server.
.. note:: You must authenticate with the Enterprise Server before calling this.
@@ -230,9 +246,7 @@ def acquire_license(duration, _cache=True):
:param int duration: Desired length of license checkout, in seconds.
:param bool _cache: Deprecated but left in for compatibility
"""
- if not core.BNAcquireEnterpriseServerLicense(duration):
- raise RuntimeError(last_error())
-
+ update_license(duration, _cache)
def release_license():
"""