Sync from oslo.incubator
Update imports from oslo.incubator and remove old modules no longer used. Change-Id: Ibb71a7287f46709bb76c3dac5ce4be7a2f4818a3
This commit is contained in:
parent
17067b938d
commit
98b92f960b
|
@ -17,14 +17,14 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
|||
"""
|
||||
|
||||
try:
|
||||
import oslo.i18n
|
||||
import oslo_i18n
|
||||
|
||||
# NOTE(dhellmann): This reference to o-s-l-o will be replaced by the
|
||||
# application name when this module is synced into the separate
|
||||
# repository. It is OK to have more than one translation function
|
||||
# using the same domain, since there will still only be one message
|
||||
# catalog.
|
||||
_translators = oslo.i18n.TranslatorFactory(domain='ironic_python_agent')
|
||||
_translators = oslo_i18n.TranslatorFactory(domain='ironic_python_agent')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
@ -40,6 +40,6 @@ try:
|
|||
_LC = _translators.log_critical
|
||||
except ImportError:
|
||||
# NOTE(dims): Support for cases where a project wants to use
|
||||
# code from ironic_python_agent-incubator, but is not ready to be internationalized
|
||||
# code from oslo-incubator, but is not ready to be internationalized
|
||||
# (like tempest)
|
||||
_ = _LI = _LW = _LE = _LC = lambda x: x
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import sys
|
||||
import time
|
||||
|
||||
|
@ -22,7 +23,6 @@ from eventlet import event
|
|||
from eventlet import greenthread
|
||||
|
||||
from ironic_python_agent.openstack.common._i18n import _LE, _LW
|
||||
from ironic_python_agent.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -84,9 +84,9 @@ class FixedIntervalLoopingCall(LoopingCallBase):
|
|||
break
|
||||
delay = end - start - interval
|
||||
if delay > 0:
|
||||
LOG.warn(_LW('task %(func_name)s run outlasted '
|
||||
LOG.warn(_LW('task %(func_name)r run outlasted '
|
||||
'interval by %(delay).2f sec'),
|
||||
{'func_name': repr(self.f), 'delay': delay})
|
||||
{'func_name': self.f, 'delay': delay})
|
||||
greenthread.sleep(-delay if delay < 0 else 0)
|
||||
except LoopingCallDone as e:
|
||||
self.stop()
|
||||
|
@ -127,9 +127,9 @@ class DynamicLoopingCall(LoopingCallBase):
|
|||
|
||||
if periodic_interval_max is not None:
|
||||
idle = min(idle, periodic_interval_max)
|
||||
LOG.debug('Dynamic looping call %(func_name)s sleeping '
|
||||
LOG.debug('Dynamic looping call %(func_name)r sleeping '
|
||||
'for %(idle).02f seconds',
|
||||
{'func_name': repr(self.f), 'idle': idle})
|
||||
{'func_name': self.f, 'idle': idle})
|
||||
greenthread.sleep(idle)
|
||||
except LoopingCallDone as e:
|
||||
self.stop()
|
||||
|
|
Loading…
Reference in New Issue