From 50abfd5e2788c1c616855b7d7b669b195d7921ab Mon Sep 17 00:00:00 2001 From: Lyle Mantooth Date: Mon, 1 Aug 2016 11:08:04 -0400 Subject: [PATCH] Remove file extension from policy names (#3805) Fixes #3804. Prevents `__file__` from contributing ".", which is an illegal character in ELB policy names. --- cloud/amazon/ec2_elb_lb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud/amazon/ec2_elb_lb.py b/cloud/amazon/ec2_elb_lb.py index e81e1ff6b9d..c4ef8b348f2 100644 --- a/cloud/amazon/ec2_elb_lb.py +++ b/cloud/amazon/ec2_elb_lb.py @@ -976,7 +976,7 @@ class ElbManager(object): self.elb_conn.modify_lb_attribute(self.name, 'ConnectingSettings', attributes.connecting_settings) def _policy_name(self, policy_type): - return __file__.split('/')[-1].replace('_', '-') + '-' + policy_type + return __file__.split('/')[-1].split('.')[0].replace('_', '-') + '-' + policy_type def _create_policy(self, policy_param, policy_meth, policy): getattr(self.elb_conn, policy_meth )(policy_param, self.elb.name, policy)