Skip to content

Commit f5eb8bc

Browse files
committed
Cisco: fix bug with RefObjectName
1 parent 1dac9ab commit f5eb8bc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

CiscoMigration/CiscoCommands.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,7 @@ public override void Parse(CiscoCommand command, CiscoCommand prevCommand, Dicti
18461846
}
18471847
}
18481848

1849+
18491850
public class Cisco_AccessList : CiscoCommand
18501851
{
18511852
public enum ActionType { NA, Deny, Permit };
@@ -1907,6 +1908,9 @@ public SourceDest(List<string> words) : this()
19071908
if (words.Count > 1)
19081909
{
19091910
RefObjectName = words[1];
1911+
var NameValidityRegex = @"[^A-Za-z0-9_.-]";
1912+
RefObjectName = Validators.ChangeNameAccordingToRules(RefObjectName);
1913+
Regex.Replace(RefObjectName, NameValidityRegex, "_");
19101914
WordsCount = 2;
19111915
}
19121916
break;
@@ -1916,6 +1920,9 @@ public SourceDest(List<string> words) : this()
19161920
if (words.Count > 1)
19171921
{
19181922
RefObjectName = InterfacePrefix + words[1];
1923+
var NameValidityRegex = @"[^A-Za-z0-9_.-]";
1924+
RefObjectName = Validators.ChangeNameAccordingToRules(RefObjectName);
1925+
Regex.Replace(RefObjectName, NameValidityRegex, "_");
19191926
WordsCount = 2;
19201927
}
19211928
break;

0 commit comments

Comments
 (0)