log.warn --> log.warning in cqlengine (deprecated)
This commit is contained in:
@@ -185,7 +185,7 @@ class Column(object):
|
||||
if polymorphic_key:
|
||||
msg = "polymorphic_key is deprecated. Use discriminator_column instead."
|
||||
warnings.warn(msg, DeprecationWarning)
|
||||
log.warn(msg)
|
||||
log.warning(msg)
|
||||
|
||||
self.discriminator_column = discriminator_column or polymorphic_key
|
||||
self.polymorphic_key = self.discriminator_column
|
||||
|
||||
@@ -54,7 +54,7 @@ def default():
|
||||
global cluster, session
|
||||
|
||||
if session:
|
||||
log.warn("configuring new connection for cqlengine when one was already set")
|
||||
log.warning("configuring new connection for cqlengine when one was already set")
|
||||
|
||||
cluster = Cluster()
|
||||
session = cluster.connect()
|
||||
@@ -75,7 +75,7 @@ def set_session(s):
|
||||
global cluster, session
|
||||
|
||||
if session:
|
||||
log.warn("configuring new connection for cqlengine when one was already set")
|
||||
log.warning("configuring new connection for cqlengine when one was already set")
|
||||
|
||||
if s.row_factory is not dict_factory:
|
||||
raise CQLEngineException("Failed to initialize: 'Session.row_factory' must be 'dict_factory'.")
|
||||
@@ -130,7 +130,7 @@ def setup(
|
||||
log.debug("cqlengine connection initialized with internally created session")
|
||||
except NoHostAvailable:
|
||||
if retry_connect:
|
||||
log.warn("connect failed, setting up for re-attempt on first use")
|
||||
log.warning("connect failed, setting up for re-attempt on first use")
|
||||
kwargs['default_keyspace'] = default_keyspace
|
||||
kwargs['consistency'] = consistency
|
||||
kwargs['lazy_connect'] = False
|
||||
|
||||
@@ -61,7 +61,7 @@ def create_keyspace(name, strategy_class, replication_factor, durable_writes=Tru
|
||||
|
||||
msg = "Deprecated. Use create_keyspace_simple or create_keyspace_network_topology instead"
|
||||
warnings.warn(msg, DeprecationWarning)
|
||||
log.warn(msg)
|
||||
log.warning(msg)
|
||||
|
||||
cluster = get_cluster()
|
||||
|
||||
@@ -143,7 +143,7 @@ def _create_keyspace(name, durable_writes, strategy_class, strategy_options):
|
||||
def delete_keyspace(name):
|
||||
msg = "Deprecated. Use drop_keyspace instead"
|
||||
warnings.warn(msg, DeprecationWarning)
|
||||
log.warn(msg)
|
||||
log.warning(msg)
|
||||
drop_keyspace(name)
|
||||
|
||||
|
||||
@@ -532,6 +532,6 @@ def _allow_schema_modification():
|
||||
if not os.getenv(CQLENG_ALLOW_SCHEMA_MANAGEMENT):
|
||||
msg = CQLENG_ALLOW_SCHEMA_MANAGEMENT + " environment variable is not set. Future versions of this package will require this variable to enable management functions."
|
||||
warnings.warn(msg)
|
||||
log.warn(msg)
|
||||
log.warning(msg)
|
||||
|
||||
return True
|
||||
|
||||
@@ -773,7 +773,7 @@ class ModelMetaClass(type):
|
||||
if poly_key:
|
||||
msg = '__polymorphic_key__ is deprecated. Use __discriminator_value__ instead'
|
||||
warnings.warn(msg, DeprecationWarning)
|
||||
log.warn(msg)
|
||||
log.warning(msg)
|
||||
attrs['__discriminator_value__'] = attrs.get('__discriminator_value__', poly_key)
|
||||
attrs['__polymorphic_key__'] = attrs['__discriminator_value__']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user