Merge "Add new log messages where it's needed"
This commit is contained in:
commit
d7297357fc
@ -162,12 +162,12 @@ def make_app():
|
||||
|
||||
|
||||
def _load_driver(namespace, name):
|
||||
# TODO(starodubcevna): add LI here in the future for logging improvement
|
||||
extension_manager = stevedore.DriverManager(
|
||||
namespace=namespace,
|
||||
name=name,
|
||||
invoke_on_load=True
|
||||
)
|
||||
LOG.info(_LI("Driver {name} successfully loaded").format(name=name))
|
||||
|
||||
return extension_manager.driver
|
||||
|
||||
|
@ -115,12 +115,18 @@ class DirectEngine(e.Engine):
|
||||
|
||||
if rollback_info.get('shutdown', False):
|
||||
self._rollback_cluster_creation(cluster, reason)
|
||||
LOG.warning(_LW("Cluster {name} creation rollback "
|
||||
"(reason: {reason})").format(name=cluster.name,
|
||||
reason=reason))
|
||||
return False
|
||||
|
||||
instance_ids = rollback_info.get('instance_ids', [])
|
||||
if instance_ids:
|
||||
self._rollback_cluster_scaling(
|
||||
cluster, g.get_instances(cluster, instance_ids), reason)
|
||||
LOG.warning(_LW("Cluster {name} scaling rollback "
|
||||
"(reason: {reason})").format(name=cluster.name,
|
||||
reason=reason))
|
||||
|
||||
return True
|
||||
|
||||
@ -481,19 +487,11 @@ class DirectEngine(e.Engine):
|
||||
|
||||
def _rollback_cluster_creation(self, cluster, ex):
|
||||
"""Shutdown all instances and update cluster status."""
|
||||
# TODO(starodubcevna): Need to add LOG.warning to upper level in next
|
||||
# commits
|
||||
LOG.debug("Cluster {name} creation rollback "
|
||||
"(reason: {reason})".format(name=cluster.name, reason=ex))
|
||||
|
||||
self.shutdown_cluster(cluster)
|
||||
|
||||
def _rollback_cluster_scaling(self, cluster, instances, ex):
|
||||
# TODO(starodubcevna): Need to add LOG.warning to upper level in next
|
||||
# commits
|
||||
"""Attempt to rollback cluster scaling."""
|
||||
LOG.debug("Cluster {name} scaling rollback "
|
||||
"(reason: {reason})".format(name=cluster.name, reason=ex))
|
||||
|
||||
for i in instances:
|
||||
self._shutdown_instance(i)
|
||||
|
@ -101,6 +101,9 @@ class HeatEngine(e.Engine):
|
||||
|
||||
if rollback_info.get('shutdown', False):
|
||||
self._rollback_cluster_creation(cluster, reason)
|
||||
LOG.warning(_LW("Cluster {name} creation rollback "
|
||||
"(reason: {reason})").format(name=cluster.name,
|
||||
reason=reason))
|
||||
return False
|
||||
|
||||
rollback_count = rollback_info.get('rollback_count', {}).copy()
|
||||
@ -108,6 +111,9 @@ class HeatEngine(e.Engine):
|
||||
if rollback_count or target_count:
|
||||
self._rollback_cluster_scaling(
|
||||
cluster, rollback_count, target_count, reason)
|
||||
LOG.warning(_LW("Cluster {name} scaling rollback "
|
||||
"(reason: {reason})").format(name=cluster.name,
|
||||
reason=reason))
|
||||
|
||||
return True
|
||||
|
||||
@ -149,12 +155,6 @@ class HeatEngine(e.Engine):
|
||||
def _rollback_cluster_creation(self, cluster, ex):
|
||||
"""Shutdown all instances and update cluster status."""
|
||||
|
||||
# TODO(starodubcevna): Need to add LOG.warning to upper level in next
|
||||
# commits
|
||||
LOG.debug("Cluster {name} creation rollback "
|
||||
"(reason: {reason})".format(name=cluster.name,
|
||||
reason=ex))
|
||||
|
||||
self.shutdown_cluster(cluster)
|
||||
|
||||
def _rollback_cluster_scaling(self, cluster, rollback_count,
|
||||
@ -168,12 +168,6 @@ class HeatEngine(e.Engine):
|
||||
maximize the chance of rollback success.
|
||||
"""
|
||||
|
||||
# TODO(starodubcevna): Need to add LOG.warning to upper level in next
|
||||
# commits
|
||||
LOG.debug("Cluster {name} scaling rollback "
|
||||
"(reason: {reason})".format(name=cluster.name,
|
||||
reason=ex))
|
||||
|
||||
for ng in rollback_count:
|
||||
if rollback_count[ng] > target_count[ng]:
|
||||
rollback_count[ng] = target_count[ng]
|
||||
|
Loading…
Reference in New Issue
Block a user