~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/openstack/common/loopingcall.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
17
 
 
18
import logging
18
19
import sys
19
20
import time
20
21
 
21
22
from eventlet import event
22
23
from eventlet import greenthread
23
24
 
24
 
from ironic.openstack.common.gettextutils import _LE, _LW
25
 
from ironic.openstack.common import log as logging
 
25
from ironic.openstack.common._i18n import _LE, _LW
26
26
 
27
27
LOG = logging.getLogger(__name__)
28
28
 
84
84
                        break
85
85
                    delay = end - start - interval
86
86
                    if delay > 0:
87
 
                        LOG.warn(_LW('task %(func_name)s run outlasted '
 
87
                        LOG.warn(_LW('task %(func_name)r run outlasted '
88
88
                                     'interval by %(delay).2f sec'),
89
 
                                 {'func_name': repr(self.f), 'delay': delay})
 
89
                                 {'func_name': self.f, 'delay': delay})
90
90
                    greenthread.sleep(-delay if delay < 0 else 0)
91
91
            except LoopingCallDone as e:
92
92
                self.stop()
127
127
 
128
128
                    if periodic_interval_max is not None:
129
129
                        idle = min(idle, periodic_interval_max)
130
 
                    LOG.debug('Dynamic looping call %(func_name)s sleeping '
 
130
                    LOG.debug('Dynamic looping call %(func_name)r sleeping '
131
131
                              'for %(idle).02f seconds',
132
 
                              {'func_name': repr(self.f), 'idle': idle})
 
132
                              {'func_name': self.f, 'idle': idle})
133
133
                    greenthread.sleep(idle)
134
134
            except LoopingCallDone as e:
135
135
                self.stop()