Stop depending on oslo.utils
We use it only in one place, which can be easily replaced. Change-Id: Ic878e890de68c087eef1a791938ecfc8275c30bc
This commit is contained in:
parent
1037276d61
commit
86ef953d49
@ -16,8 +16,9 @@
|
||||
import collections
|
||||
import logging
|
||||
import random
|
||||
import sys
|
||||
|
||||
from oslo_utils import excutils
|
||||
import six
|
||||
|
||||
from metalsmith import _exceptions
|
||||
from metalsmith import _os_api
|
||||
@ -138,10 +139,17 @@ class Provisioner(object):
|
||||
# Update the node to return it's latest state
|
||||
node = self._api.get_node(node)
|
||||
except Exception:
|
||||
with excutils.save_and_reraise_exception():
|
||||
exc_info = sys.exc_info()
|
||||
|
||||
try:
|
||||
LOG.error('Deploy attempt failed on node %s, cleaning up',
|
||||
_utils.log_node(node))
|
||||
self._clean_up(node, created_ports, attached_ports)
|
||||
self._delete_ports(node, created_ports, attached_ports)
|
||||
self._api.release_node(node)
|
||||
except Exception:
|
||||
LOG.exception('Clean up failed')
|
||||
|
||||
six.reraise(*exc_info)
|
||||
|
||||
if wait is not None:
|
||||
LOG.info('Deploy succeeded on node %s', _utils.log_node(node))
|
||||
@ -164,13 +172,6 @@ class Provisioner(object):
|
||||
else:
|
||||
LOG.warning('No IPs for node %s', _utils.log_node(node))
|
||||
|
||||
def _clean_up(self, node, created_ports, attached_ports):
|
||||
try:
|
||||
self._delete_ports(node, created_ports, attached_ports)
|
||||
self._api.release_node(node)
|
||||
except Exception:
|
||||
LOG.exception('Clean up failed')
|
||||
|
||||
def _get_nics(self, nics):
|
||||
"""Validate and get the NICs."""
|
||||
result = []
|
||||
|
@ -3,6 +3,5 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
openstacksdk>=0.11.0 # Apache-2.0
|
||||
oslo.utils>=3.20.0 # Apache-2.0
|
||||
python-ironicclient>=1.14.0 # Apache-2.0
|
||||
six>=1.10.0 # MIT
|
||||
|
Loading…
Reference in New Issue
Block a user