1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-08-24 17:49:28 +03:00

M #-: Fix possible NIC name collision (#962)

This commit is contained in:
Pavel Czerný
2021-03-12 13:09:04 +01:00
committed by GitHub
parent 1b3f3d700a
commit f7f076c638

View File

@ -118,6 +118,15 @@ public:
if (!name.empty())
{
if (one_util::regex_match("^NIC[[:digit:]]+(_ALIAS[[:digit:]]+)?$",
name.c_str()) == 0)
{
// Name collide with internal naming convention
name = '_' + name;
replace("NAME", name);
}
return name;
}
@ -141,6 +150,15 @@ public:
if (!name.empty())
{
if (one_util::regex_match("^NIC[[:digit:]]+(_ALIAS[[:digit:]]+)?$",
name.c_str()) == 0)
{
// Name collide with internal naming convention
name = '_' + name;
replace("NAME", name);
}
return name;
}