summaryrefslogtreecommitdiff
path: root/python/enterprise.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-04-08 17:10:57 -0400
committerGlenn Smith <glenn@vector35.com>2022-05-02 15:59:59 -0400
commit4afc9c92334943c1988581c0be1295ec44f29902 (patch)
tree2e043eeeebbdce386371f92e53d318b1a355c01b /python/enterprise.py
parentbbbe4d177c378077b43b09c74a3a20a09bfee443 (diff)
[Enterprise] Always cache licenses
Diffstat (limited to 'python/enterprise.py')
-rw-r--r--python/enterprise.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/python/enterprise.py b/python/enterprise.py
index c0fe22da..cc770326 100644
--- a/python/enterprise.py
+++ b/python/enterprise.py
@@ -200,7 +200,7 @@ def reservation_time_limit() -> int:
return core.BNGetEnterpriseServerReservationTimeLimit()
-def acquire_license(duration, cache=False):
+def acquire_license(duration, _cache=True):
"""
Check out and activate a license from the Enterprise Server.
If ``cache`` is True, the checkout will be saved to a local secrets storage. This is platform-dependent:
@@ -215,9 +215,9 @@ def acquire_license(duration, cache=False):
have to either wait for the checkout to expire or have an administrator revoke the checkout.
:param int duration: Desired length of license checkout, in seconds.
- :param bool cache: If true, the license will be saved to a local secrets storage.
+ :param bool _cache: Deprecated but left in for compatibility
"""
- if not core.BNAcquireEnterpriseServerLicense(duration, cache):
+ if not core.BNAcquireEnterpriseServerLicense(duration):
raise RuntimeError(last_error())
@@ -288,9 +288,8 @@ class LicenseCheckout:
# License is released at end of scope
"""
- def __init__(self, duration=900, cache=False):
+ def __init__(self, duration=900, _cache=True):
self.desired_duration = duration
- self.desired_cache = cache
self.acquired_license = False
def __enter__(self):
@@ -327,7 +326,7 @@ class LicenseCheckout:
# Keychain auth can activate a license if we have one in the keychain
if not is_license_still_activated():
- acquire_license(self.desired_duration, self.desired_cache)
+ acquire_license(self.desired_duration)
self.acquired_license = True
def __exit__(self, exc_type, exc_val, exc_tb):