mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
rax_scaling_group: fix sanity check (#5563)
* rax_scaling_group: fix sanity check * add changelog fragment * added missing call to expanduser()
This commit is contained in:
parent
e87ca10b61
commit
6a03108609
8 changed files with 26 additions and 20 deletions
|
@ -314,3 +314,21 @@ def setup_rax_module(module, rax_module, region_required=True):
|
|||
(region, ','.join(rax_module.regions)))
|
||||
|
||||
return rax_module
|
||||
|
||||
|
||||
def rax_scaling_group_personality_file(module, files):
|
||||
if not files:
|
||||
return []
|
||||
|
||||
results = []
|
||||
for rpath, lpath in files.items():
|
||||
lpath = os.path.expanduser(lpath)
|
||||
try:
|
||||
with open(lpath, 'r') as f:
|
||||
results.append({
|
||||
'path': rpath,
|
||||
'contents': f.read(),
|
||||
})
|
||||
except Exception as e:
|
||||
module.fail_json(msg='Failed to load %s: %s' % (lpath, str(e)))
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue