Fix unused and conflicting variables
Prefix '_' to denote unused variables Suffix '_' to avoid conflicting with Python built-in funcs Change-Id: I4e0d0b8f88e5c93222fbd7f8dc7cf626923f738e
This commit is contained in:
		| @@ -342,7 +342,7 @@ class PatternCompiler(object): | |||||||
|             node.add(tr.Node(flow.retry)) |             node.add(tr.Node(flow.retry)) | ||||||
|         decomposed_members = {} |         decomposed_members = {} | ||||||
|         for item in flow: |         for item in flow: | ||||||
|             subgraph, subnode = self._flatten(item, node) |             subgraph, _subnode = self._flatten(item, node) | ||||||
|             decomposed_members[item] = subgraph |             decomposed_members[item] = subgraph | ||||||
|             if subgraph.number_of_nodes(): |             if subgraph.number_of_nodes(): | ||||||
|                 graph = gr.merge_graphs([graph, subgraph]) |                 graph = gr.merge_graphs([graph, subgraph]) | ||||||
|   | |||||||
| @@ -149,9 +149,9 @@ class DeclareSuccess(task.Task): | |||||||
|  |  | ||||||
|  |  | ||||||
| class DummyUser(object): | class DummyUser(object): | ||||||
|     def __init__(self, user, id): |     def __init__(self, user, id_): | ||||||
|         self.user = user |         self.user = user | ||||||
|         self.id = id |         self.id = id_ | ||||||
|  |  | ||||||
|  |  | ||||||
| # Resources (db handles and similar) of course can *not* be persisted so we | # Resources (db handles and similar) of course can *not* be persisted so we | ||||||
| @@ -174,7 +174,7 @@ flow.add(sub_flow) | |||||||
| # prepopulating this allows the tasks that dependent on the 'request' variable | # prepopulating this allows the tasks that dependent on the 'request' variable | ||||||
| # to start processing (in this case this is the ExtractInputRequest task). | # to start processing (in this case this is the ExtractInputRequest task). | ||||||
| store = { | store = { | ||||||
|     'request': DummyUser(user="bob", id="1.35"), |     'request': DummyUser(user="bob", id_="1.35"), | ||||||
| } | } | ||||||
| eng = engines.load(flow, engine='serial', store=store) | eng = engines.load(flow, engine='serial', store=store) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -48,7 +48,7 @@ def _exec(cmd, add_env=None): | |||||||
|                             stdout=subprocess.PIPE, |                             stdout=subprocess.PIPE, | ||||||
|                             stderr=sys.stderr) |                             stderr=sys.stderr) | ||||||
|  |  | ||||||
|     stdout, stderr = proc.communicate() |     stdout, _stderr = proc.communicate() | ||||||
|     rc = proc.returncode |     rc = proc.returncode | ||||||
|     if rc != 0: |     if rc != 0: | ||||||
|         raise RuntimeError("Could not run %s [%s]", cmd, rc) |         raise RuntimeError("Could not run %s [%s]", cmd, rc) | ||||||
|   | |||||||
| @@ -143,7 +143,7 @@ class AllocateIP(task.Task): | |||||||
|  |  | ||||||
|     def execute(self, vm_spec): |     def execute(self, vm_spec): | ||||||
|         ips = [] |         ips = [] | ||||||
|         for i in range(0, vm_spec.get('ips', 0)): |         for _i in range(0, vm_spec.get('ips', 0)): | ||||||
|             ips.append("192.168.0.%s" % (random.randint(1, 254))) |             ips.append("192.168.0.%s" % (random.randint(1, 254))) | ||||||
|         return ips |         return ips | ||||||
|  |  | ||||||
|   | |||||||
| @@ -131,7 +131,7 @@ def calculate(engine_conf): | |||||||
|     task_names = [] |     task_names = [] | ||||||
|  |  | ||||||
|     # Compose our workflow. |     # Compose our workflow. | ||||||
|     height, width = IMAGE_SIZE |     height, _width = IMAGE_SIZE | ||||||
|     chunk_size = int(math.ceil(height / float(CHUNK_COUNT))) |     chunk_size = int(math.ceil(height / float(CHUNK_COUNT))) | ||||||
|     for i in compat_range(0, CHUNK_COUNT): |     for i in compat_range(0, CHUNK_COUNT): | ||||||
|         chunk_name = 'chunk_%s' % i |         chunk_name = 'chunk_%s' % i | ||||||
|   | |||||||
| @@ -205,7 +205,7 @@ class FSM(object): | |||||||
|  |  | ||||||
|     def run(self, event, initialize=True): |     def run(self, event, initialize=True): | ||||||
|         """Runs the state machine, using reactions only.""" |         """Runs the state machine, using reactions only.""" | ||||||
|         for transition in self.run_iter(event, initialize=initialize): |         for _transition in self.run_iter(event, initialize=initialize): | ||||||
|             pass |             pass | ||||||
|  |  | ||||||
|     def copy(self): |     def copy(self): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Changbin Liu
					Changbin Liu