mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
fixed a bug in transform_name (#50213)
This commit is contained in:
committed by
Tim Rupp
parent
4d6807a6b0
commit
78e81b2965
@@ -325,10 +325,19 @@ def is_valid_fqdn(host):
|
||||
|
||||
|
||||
def transform_name(partition='', name='', sub_path=''):
|
||||
if partition != '':
|
||||
if name.startswith(partition + '/'):
|
||||
name = name.replace(partition + '/', '')
|
||||
if name.startswith('/' + partition + '/'):
|
||||
name = name.replace('/' + partition + '/', '')
|
||||
|
||||
if name:
|
||||
name = name.replace('/', '~')
|
||||
|
||||
if partition:
|
||||
partition = '~' + partition
|
||||
partition = partition.replace('/', '~')
|
||||
if not partition.startswith('~'):
|
||||
partition = '~' + partition
|
||||
else:
|
||||
if sub_path:
|
||||
raise F5ModuleError(
|
||||
|
||||
Reference in New Issue
Block a user