mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Port modules away from __file__
* __file__ won't work if we want to invoke modules via -m or if we figure out how to keep modules from hitting the disk with pipelining. * module.tmpdir is the new way to place a file where it will be cleaned automatically. Change format string to not depend on __file__: * cloud/amazon/ec2_elb_lb.py * cloud/amazon/elb_classic_lb.py Use module.tempdir: * packaging/os/apt.py * files/unarchive.py
This commit is contained in:
@@ -980,7 +980,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].split('.')[0].replace('_', '-') + '-' + policy_type
|
||||
return 'ec2-elb-lb-{0}'.format(to_native(policy_type, errors='surrogate_or_strict'))
|
||||
|
||||
def _create_policy(self, policy_param, policy_meth, policy):
|
||||
getattr(self.elb_conn, policy_meth)(policy_param, self.elb.name, policy)
|
||||
|
||||
@@ -977,7 +977,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].split('.')[0].replace('_', '-') + '-' + policy_type
|
||||
return 'elb-classic-lb-{0}'.format(to_native(policy_type, errors='surrogate_or_strict'))
|
||||
|
||||
def _create_policy(self, policy_param, policy_meth, policy):
|
||||
getattr(self.elb_conn, policy_meth)(policy_param, self.elb.name, policy)
|
||||
|
||||
Reference in New Issue
Block a user