methods maybe static

Change-Id: I87b52c84c02b95c9317c1d122814ca0d1b84f27d
This commit is contained in:
Eyal 2016-03-13 10:18:09 +02:00
parent 2bc00b5462
commit 23022f44cb
4 changed files with 11 additions and 6 deletions

View File

@ -4,7 +4,7 @@
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to vitrage's documentation! Welcome to vitrage's documentation!
======================================================== ===================================
Contents: Contents:

View File

@ -114,7 +114,8 @@ class ScenarioRepository(object):
if not self.contains(scenarios, scenario): if not self.contains(scenarios, scenario):
self.relationship_scenarios[key].append((edge_desc, scenario)) self.relationship_scenarios[key].append((edge_desc, scenario))
def _create_edge_scenario_key(self, edge_desc): @staticmethod
def _create_edge_scenario_key(edge_desc):
return EdgeKeyScenario(edge_desc.edge.label, return EdgeKeyScenario(edge_desc.edge.label,
frozenset(edge_desc.source.properties.items()), frozenset(edge_desc.source.properties.items()),

View File

@ -124,7 +124,8 @@ class Template(object):
target = self.entities[target_id] target = self.entities[target_id]
return EdgeDescription(edge, source, target) return EdgeDescription(edge, source, target)
def _extract_properties(self, var_dict): @staticmethod
def _extract_properties(var_dict):
ignore_ids = [TFields.TEMPLATE_ID, TFields.SOURCE, TFields.TARGET] ignore_ids = [TFields.TEMPLATE_ID, TFields.SOURCE, TFields.TARGET]
return dict((key, var_dict[key]) for key in var_dict return dict((key, var_dict[key]) for key in var_dict
@ -143,7 +144,8 @@ class Template(object):
return scenarios return scenarios
def _build_actions(self, actions_def): @staticmethod
def _build_actions(actions_def):
actions = [] actions = []
for action_def in actions_def: for action_def in actions_def:
@ -187,7 +189,8 @@ class Template(object):
if isinstance(condition_dnf, Symbol): if isinstance(condition_dnf, Symbol):
return [[(self._extract_condition_var(condition_dnf, True))]] return [[(self._extract_condition_var(condition_dnf, True))]]
def convert_to_dnf_format(self, condition_str): @staticmethod
def convert_to_dnf_format(condition_str):
condition_str = condition_str.replace('and', '&') condition_str = condition_str.replace('and', '&')
condition_str = condition_str.replace('or', '|') condition_str = condition_str.replace('or', '|')

View File

@ -50,7 +50,8 @@ class TestBaseProcessor(TestEntityGraphUnitBase):
return vertex return vertex
def _update_edge_to_graph(self, entity_graph, src_id, trgt_id, label): @staticmethod
def _update_edge_to_graph(entity_graph, src_id, trgt_id, label):
edge = graph.Edge(src_id, trgt_id, label, {}) edge = graph.Edge(src_id, trgt_id, label, {})
entity_graph.add_edge(edge) entity_graph.add_edge(edge)
return edge return edge