fixed a bug in transform_name (#50213)

pull/50464/head
Wojciech Wypior 6 years ago 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(

Loading…
Cancel
Save