Use exclamation mark for auto-generated config item names.

Fixes #5318
This commit is contained in:
Michael Friedrich 2013-12-12 11:48:43 +01:00
parent ed4def7ee8
commit e6c6a7dc52
5 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ define objects the `object` keyword is used:
> **Note**
>
> Colons (:) are not permitted in object names.
> Exclamation marks (!) are not permitted in object names.
Each object is uniquely identified by its type (`Host`) and name
(`host1.example.org`). Objects can contain a comma-separated list of

View File

@ -352,9 +352,9 @@ object_declaration identifier T_STRING object_inherits_specifier expressionlist
item->SetType($3);
if (strchr($4, ':') != NULL) {
if (strchr($4, '!') != NULL) {
std::ostringstream msgbuf;
msgbuf << "Name for object '" << $4 << "' of type '" << $3 << "' is invalid: Object names may not contain ':'";
msgbuf << "Name for object '" << $4 << "' of type '" << $3 << "' is invalid: Object names may not contain '!'";
free($3);
BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
}

View File

@ -152,7 +152,7 @@ void Host::UpdateSlaveServices(void)
ObjectLock olock(service_descriptions);
BOOST_FOREACH(const Dictionary::Pair& kv, service_descriptions) {
std::ostringstream namebuf;
namebuf << GetName() << ":" << kv.first;
namebuf << GetName() << "!" << kv.first;
String name = namebuf.str();
std::vector<String> path;

View File

@ -334,7 +334,7 @@ void Service::UpdateSlaveScheduledDowntimes(void)
BOOST_FOREACH(const Dictionary::Pair& kv, descs) {
std::ostringstream namebuf;
namebuf << GetName() << ":" << kv.first;
namebuf << GetName() << "!" << kv.first;
String name = namebuf.str();
std::vector<String> path;

View File

@ -111,7 +111,7 @@ void Service::UpdateSlaveNotifications(void)
BOOST_FOREACH(const Dictionary::Pair& kv, descs) {
std::ostringstream namebuf;
namebuf << GetName() << ":" << kv.first;
namebuf << GetName() << "!" << kv.first;
String name = namebuf.str();
std::vector<String> path;