# Copyright (C) 2013 INRIA
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
"""
rms = []
- for guid, rm in self._resources.iteritems():
+ for guid, rm in self._resources.items():
if rm.get_rtype() == rtype:
rms.append(rm)
return rms
:rtype: list
"""
- keys = self._resources.keys()
+ keys = list(self._resources.keys())
return keys
"""
rms = []
- for guid, rm in self._resources.iteritems():
+ for guid, rm in self._resources.items():
if rm.get_rtype() == rtype:
rms.append(rm.guid)
return rms
if not guids:
# If no guids list was passed, all 'NEW' RMs will be deployed
guids = []
- for guid, rm in self._resources.iteritems():
+ for guid, rm in self._resources.items():
if rm.state == ResourceState.NEW:
guids.append(guid)
new_group = False
if not group:
new_group = True
- group = self._group_id_generator.next()
+ group = next(self._group_id_generator)
if group not in self._groups:
self._groups[group] = []
"""
if self._state == ECState.RELEASED:
- return
+ return
if isinstance(guids, int):
guids = [guids]
try:
self._cond.acquire()
- task = self._scheduler.next()
+ task = next(self._scheduler)
if not task:
# No task to execute. Wait for a new task to be scheduled.