Skip to content

Commit

Permalink
{ARC} fix: update logic to sanitize cluster name for dc* objects (Azu…
Browse files Browse the repository at this point in the history
  • Loading branch information
bragi92 authored Aug 1, 2023
1 parent 4fa705d commit 980d53b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# All DC* object names should end only in alpha numeric (after `length` trim)
# DCE remove underscore from cluster name
def sanitize_name(name, objtype, length):
name = name[0:length]
length = length - 1
if objtype == DC_TYPE.DCE:
name = name.replace("_", "")
name = name[0:length]
name = ''.join(char for char in name if char.isalnum() or char == '-')
lastIndexAlphaNumeric = len(name) - 1
while ((name[lastIndexAlphaNumeric].isalnum() is False) and lastIndexAlphaNumeric > -1):
lastIndexAlphaNumeric = lastIndexAlphaNumeric - 1
Expand Down

0 comments on commit 980d53b

Please sign in to comment.