Skip to content

Commit

Permalink
Adapted transient rule
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepSampe committed Oct 25, 2017
1 parent 531bd0e commit e40c24f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/policies/actors/rule_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def update(self, metric, tenant_info):
self.observers_values[metric] = tenant_info

if all(val is not None for val in self.observers_values.values()):
condition_accomplished = self._check_conditions(self.conditions)
condition_accomplished = self._check_conditions(self.condition_list)
if condition_accomplished != self.execution_stat:
self.do_action(condition_accomplished)
self.execution_stat = condition_accomplished
Expand All @@ -78,7 +78,7 @@ def do_action(self, condition_result):
# TODO Review if this tenant has already deployed this filter. Don't deploy the same filter more than one time.
logger.info("Setting static policy")
data = dict()
url = os.path.join(self.controller_server, 'filters', self.target_id, "deploy", str(self.filter))
url = os.path.join('http://'+self.controller_server, 'filters', self.target_id, "deploy", str(self.filter))

data['object_type'] = self.object_type
data['object_size'] = self.object_size
Expand All @@ -96,7 +96,7 @@ def do_action(self, condition_result):

elif action == "DELETE":
logger.info("Deleting static policy " + str(self.static_policy_id))
url = os.path.join(self.controller_server, "policies/static", self.target_id+":"+str(self.static_policy_id))
url = os.path.join('http://'+self.controller_server, "policies/static", self.target_id+":"+str(self.static_policy_id))
response = requests.delete(url, headers=headers)

if 200 <= response.status_code < 300:
Expand Down

0 comments on commit e40c24f

Please sign in to comment.