mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
* rax_scaling_group: fix sanity check
* add changelog fragment
* added missing call to expanduser()
(cherry picked from commit 6a03108609)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
d6d9f84b0a
commit
2435fb3f30
8 changed files with 26 additions and 20 deletions
|
|
@ -161,8 +161,11 @@ except ImportError:
|
|||
HAS_PYRAX = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.rax import (rax_argument_spec, rax_find_image, rax_find_network,
|
||||
rax_required_together, rax_to_dict, setup_rax_module)
|
||||
from ansible_collections.community.general.plugins.module_utils.rax import (
|
||||
rax_argument_spec, rax_find_image, rax_find_network,
|
||||
rax_required_together, rax_to_dict, setup_rax_module,
|
||||
rax_scaling_group_personality_file,
|
||||
)
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
|
||||
|
|
@ -223,19 +226,7 @@ def rax_asg(module, cooldown=300, disk_config=None, files=None, flavor=None,
|
|||
del nic['net-id']
|
||||
|
||||
# Handle the file contents
|
||||
personality = []
|
||||
if files:
|
||||
for rpath in files.keys():
|
||||
lpath = os.path.expanduser(files[rpath])
|
||||
try:
|
||||
f = open(lpath, 'r')
|
||||
personality.append({
|
||||
'path': rpath,
|
||||
'contents': f.read()
|
||||
})
|
||||
f.close()
|
||||
except Exception as e:
|
||||
module.fail_json(msg='Failed to load %s' % lpath)
|
||||
personality = rax_scaling_group_personality_file(module, files)
|
||||
|
||||
lbs = []
|
||||
if loadbalancers:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue