]> granicus.if.org Git - icinga2/commitdiff
Use exclamation mark for auto-generated config item names.
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 12 Dec 2013 10:48:43 +0000 (11:48 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 12 Dec 2013 10:50:08 +0000 (11:50 +0100)
Fixes #5318

doc/4.1-configuration-syntax.md
lib/config/config_parser.yy
lib/icinga/host.cpp
lib/icinga/service-downtime.cpp
lib/icinga/service-notification.cpp

index 2c02c9f1725b1e5923d4f9234219280fd6d3f23a..cd96ee8b299e5df34700dafad2486788981e7b17 100644 (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
index 6d8b9f0359e2b1d79ab4ff1add631cf260d59e76..486a80cf61e7dbb7d782b73f8ccee50a8543d94c 100644 (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()));
                }
index 2977e31f634ee9667857200465db318826f57a76..f38eea9c7fbdb7afd0824f74a557fc1d5dad65f0 100644 (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;
index 83b45fc434677c5a2c96e2f0489d11266733a7d8..9596c56a5c0fcf6fb23804c9fc883450902c13c4 100644 (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;
index c411b9bb0c0fab713868c2dea88797080c2e4255..ac176fa751fc51c7e610cda92bc7953008ac85ee 100644 (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;