fixed a bug in transform_name (#50213)
This commit is contained in:
parent
4d6807a6b0
commit
78e81b2965
1 changed files with 10 additions and 1 deletions
|
@ -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…
Reference in a new issue