Enable hacking N326, N327
Change-Id: Ia7c0feacc154bf36a08f1033fd5a860becfa2167
This commit is contained in:
@@ -19,6 +19,7 @@ import multiprocessing
|
||||
import operator
|
||||
import os
|
||||
import pickle
|
||||
import six
|
||||
import sys
|
||||
import time
|
||||
import zlib
|
||||
@@ -348,7 +349,7 @@ class NfpController(nfp_launcher.NfpLauncher, NfpService):
|
||||
|
||||
def _update_manager(self):
|
||||
childs = self.get_childrens()
|
||||
for pid, wrapper in childs.iteritems():
|
||||
for pid, wrapper in six.iteritems(childs):
|
||||
pipe = wrapper.child_pipe_map[pid]
|
||||
# Inform 'Manager' class about the new_child.
|
||||
self._manager.new_child(pid, pipe)
|
||||
@@ -414,7 +415,7 @@ class NfpController(nfp_launcher.NfpLauncher, NfpService):
|
||||
self._update_manager()
|
||||
|
||||
# create and launch rpc service agent for each topic
|
||||
for key, value in self._rpc_agents.iteritems():
|
||||
for key, value in six.iteritems(self._rpc_agents):
|
||||
agents = value['agents']
|
||||
# Register NFP RPC managers in priority order,
|
||||
# so that on rpc, oslo invokes them in the given order,
|
||||
@@ -454,7 +455,7 @@ class NfpController(nfp_launcher.NfpLauncher, NfpService):
|
||||
"""
|
||||
graph_sig = {}
|
||||
graph_nodes = []
|
||||
for parent, childs in graph.iteritems():
|
||||
for parent, childs in six.iteritems(graph):
|
||||
puuid = parent.desc.uuid
|
||||
assert puuid not in graph_sig.keys(), (
|
||||
"Event - %s is already root of subgraph - %s" % (
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import six
|
||||
|
||||
from argparse import Namespace
|
||||
|
||||
@@ -183,7 +184,7 @@ class EventGraphExecutor(object):
|
||||
|
||||
def _root(self, graph, of):
|
||||
tree = graph['data']
|
||||
for root, nodes in tree.iteritems():
|
||||
for root, nodes in six.iteritems(tree):
|
||||
if of in nodes:
|
||||
return root
|
||||
return None
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import six
|
||||
|
||||
from gbpservice.nfp.core import event as nfp_event
|
||||
from gbpservice.nfp.core import executor as nfp_executor
|
||||
@@ -345,7 +346,7 @@ class NfpResourceManager(NfpProcessManager, NfpEventManager):
|
||||
# Get events from sequencer
|
||||
events = self._event_sequencer.run()
|
||||
events += nfp_path.run()
|
||||
for pid, event_manager in self._resource_map.iteritems():
|
||||
for pid, event_manager in six.iteritems(self._resource_map):
|
||||
events += event_manager.event_watcher(timeout=0.01)
|
||||
# Process the type of events received, dispatch only the
|
||||
# required ones.
|
||||
@@ -401,7 +402,7 @@ class NfpResourceManager(NfpProcessManager, NfpEventManager):
|
||||
def _load_init(self):
|
||||
"""Intializes load with current information. """
|
||||
load_info = []
|
||||
for pid, event_manager in self._resource_map.iteritems():
|
||||
for pid, event_manager in six.iteritems(self._resource_map):
|
||||
load = event_manager.get_load()
|
||||
load_info.append([event_manager, load, pid])
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
from gbpservice.nfp.core import log as nfp_logging
|
||||
|
||||
import collections
|
||||
import six
|
||||
|
||||
deque = collections.deque
|
||||
|
||||
@@ -62,7 +63,7 @@ paths = {}
|
||||
|
||||
|
||||
def run():
|
||||
for key, path in paths.iteritems():
|
||||
for key, path in six.iteritems(paths):
|
||||
if path['current'].count == 0:
|
||||
path['current'].done()
|
||||
if path['waiting'].name != 'INVALID':
|
||||
@@ -72,7 +73,7 @@ def run():
|
||||
|
||||
events = []
|
||||
# Get any queued events in the current path
|
||||
for key, path in paths.iteritems():
|
||||
for key, path in six.iteritems(paths):
|
||||
events += path['current'].pop()
|
||||
return events
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
import collections
|
||||
import six
|
||||
|
||||
from gbpservice.nfp.core import log as nfp_logging
|
||||
|
||||
@@ -97,7 +98,7 @@ class EventSequencer(object):
|
||||
events = []
|
||||
# Loop over copy and delete from original
|
||||
sequencers = dict(self._sequencer)
|
||||
for key, sequencer in sequencers.iteritems():
|
||||
for key, sequencer in six.iteritems(sequencers):
|
||||
try:
|
||||
event = sequencer.run()
|
||||
if event:
|
||||
@@ -118,7 +119,7 @@ class EventSequencer(object):
|
||||
def pop(self):
|
||||
events = []
|
||||
sequencers = dict(self._sequencer)
|
||||
for key, sequencer in sequencers.iteritems():
|
||||
for key, sequencer in six.iteritems(sequencers):
|
||||
events += sequencer.pop()
|
||||
return events
|
||||
|
||||
|
||||
Reference in New Issue
Block a user