Skip to content

Commit

Permalink
prepare 6.9.3 release (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-darkly authored Jun 11, 2019
1 parent caa1ae1 commit 2ebab04
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
26 changes: 13 additions & 13 deletions ldclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
"Only one of either is expected")

if sdk_key is not None:
log.warn("Deprecated sdk_key argument was passed to init. Use config object instead.")
log.warning("Deprecated sdk_key argument was passed to init. Use config object instead.")
self._config = Config(sdk_key=sdk_key)
else:
self._config = config or Config.default()
Expand Down Expand Up @@ -113,7 +113,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
if self._update_processor.initialized() is True:
log.info("Started LaunchDarkly Client: OK")
else:
log.warn("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
log.warning("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
"Feature Flags may not yet be available.")

def _make_event_processor(self, config):
Expand All @@ -139,7 +139,7 @@ def _make_update_processor(self, config, store, ready):
return StreamingUpdateProcessor(config, feature_requester, store, ready)

log.info("Disabling streaming API")
log.warn("You should only disable the streaming API if instructed to do so by LaunchDarkly support")
log.warning("You should only disable the streaming API if instructed to do so by LaunchDarkly support")
return PollingUpdateProcessor(config, feature_requester, store, ready)

def get_sdk_key(self):
Expand Down Expand Up @@ -180,7 +180,7 @@ def track(self, event_name, user, data=None):
:param data: optional additional data associated with the event
"""
if user is None or user.get('key') is None:
log.warn("Missing user or user key when calling track().")
log.warning("Missing user or user key when calling track().")
else:
self._send_event({'kind': 'custom', 'key': event_name, 'user': user, 'data': data})

Expand All @@ -194,7 +194,7 @@ def identify(self, user):
:param dict user: attributes of the user to register
"""
if user is None or user.get('key') is None:
log.warn("Missing user or user key when calling identify().")
log.warning("Missing user or user key when calling identify().")
else:
self._send_event({'kind': 'identify', 'key': str(user.get('key')), 'user': user})

Expand Down Expand Up @@ -234,7 +234,7 @@ def toggle(self, key, user, default):
.. deprecated:: 2.0.0
"""
log.warn("Deprecated method: toggle() called. Use variation() instead.")
log.warning("Deprecated method: toggle() called. Use variation() instead.")
return self.variation(key, user, default)

def variation(self, key, user, default):
Expand Down Expand Up @@ -281,16 +281,16 @@ def send_event(value, variation=None, flag=None, reason=None):

if not self.is_initialized():
if self._store.initialized:
log.warn("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key)
log.warning("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key)
else:
log.warn("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
log.warning("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
+ str(default) + " for feature key: " + key)
reason = error_reason('CLIENT_NOT_READY')
send_event(default, None, None, reason)
return EvaluationDetail(default, None, reason)

if user is not None and user.get('key', "") == "":
log.warn("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly.")
log.warning("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly.")

try:
flag = self._store.get(FEATURES, key, lambda x: x)
Expand Down Expand Up @@ -369,18 +369,18 @@ def all_flags_state(self, user, **kwargs):
:rtype: FeatureFlagsState
"""
if self._config.offline:
log.warn("all_flags_state() called, but client is in offline mode. Returning empty state")
log.warning("all_flags_state() called, but client is in offline mode. Returning empty state")
return FeatureFlagsState(False)

if not self.is_initialized():
if self._store.initialized:
log.warn("all_flags_state() called before client has finished initializing! Using last known values from feature store")
log.warning("all_flags_state() called before client has finished initializing! Using last known values from feature store")
else:
log.warn("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state")
log.warning("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state")
return FeatureFlagsState(False)

if user is None or user.get('key') is None:
log.warn("User or user key is None when calling all_flags_state(). Returning empty state.")
log.warning("User or user key is None when calling all_flags_state(). Returning empty state.")
return FeatureFlagsState(False)

state = FeatureFlagsState(True)
Expand Down
2 changes: 1 addition & 1 deletion ldclient/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,4 @@ def inline_users_in_events(self):

def _validate(self):
if self.offline is False and self.sdk_key is None or self.sdk_key is '':
log.warn("Missing or blank sdk_key.")
log.warning("Missing or blank sdk_key.")
2 changes: 1 addition & 1 deletion ldclient/flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _check_prerequisites(flag, user, store, events, include_reasons_in_events):
for prereq in flag.get('prerequisites') or []:
prereq_flag = store.get(FEATURES, prereq.get('key'), lambda x: x)
if prereq_flag is None:
log.warn("Missing prereq flag: " + prereq.get('key'))
log.warning("Missing prereq flag: " + prereq.get('key'))
failed_prereq = prereq
else:
prereq_res = _evaluate(prereq_flag, user, store, events, include_reasons_in_events)
Expand Down
2 changes: 1 addition & 1 deletion ldclient/impl/integrations/files/file_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _start_auto_updater(self):
try:
resolved_paths.append(os.path.realpath(path))
except:
log.warn('Cannot watch for changes to data file "%s" because it is an invalid path' % path)
log.warning('Cannot watch for changes to data file "%s" because it is an invalid path' % path)
if have_watchdog and not self._force_polling:
return _FileDataSource.WatchdogAutoUpdater(resolved_paths, self._load_all)
else:
Expand Down
8 changes: 4 additions & 4 deletions ldclient/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _string_operator(u, c, fn):
def _numeric_operator(u, c, fn):
# bool is a subtype of int, and we don't want to try and compare it as a number.
if isinstance(input, bool):
log.warn("Got unexpected bool type when attempting to parse time")
log.warning("Got unexpected bool type when attempting to parse time")
return None

if isinstance(u, Number):
Expand All @@ -44,7 +44,7 @@ def _parse_time(input):

# bool is a subtype of int, and we don't want to try and compare it as a time.
if isinstance(input, bool):
log.warn("Got unexpected bool type when attempting to parse time")
log.warning("Got unexpected bool type when attempting to parse time")
return None

if isinstance(input, Number):
Expand All @@ -56,10 +56,10 @@ def _parse_time(input):
timestamp = (parsed_time - epoch).total_seconds()
return timestamp * 1000.0
except Exception as e:
log.warn("Couldn't parse timestamp:" + str(input) + " with message: " + str(e))
log.warning("Couldn't parse timestamp:" + str(input) + " with message: " + str(e))
return None

log.warn("Got unexpected type: " + type(input) + " with value: " + str(input) + " when attempting to parse time")
log.warning("Got unexpected type: " + type(input) + " with value: " + str(input) + " when attempting to parse time")
return None

def _time_operator(u, c, fn):
Expand Down
4 changes: 2 additions & 2 deletions ldclient/sse_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import re
import time
import warnings

import six

import urllib3

from ldclient.util import create_http_pool_manager
from ldclient.util import log
from ldclient.util import throw_if_unsuccessful_response

# Technically, we should support streams that mix line endings. This regex,
Expand Down Expand Up @@ -158,7 +158,7 @@ def parse(cls, raw):
m = cls.sse_line_pattern.match(line)
if m is None:
# Malformed line. Discard but warn.
warnings.warn('Invalid SSE line: "%s"' % line, SyntaxWarning)
log.warning('Invalid SSE line: "%s"' % line)
continue

name = m.groupdict()['name']
Expand Down

0 comments on commit 2ebab04

Please sign in to comment.