print "apply Dependency \"host-zone-%s\" to Host {" % (agent_info["zone"])
print " parent_host_name = \"%s\"" % (agent_info["zone"])
- print " assign where host.@zone == \"%s\"" % (agent_info["zone"])
+ print " assign where host.zone == \"%s\"" % (agent_info["zone"])
print "}"
print ""
print "apply Dependency \"service-zone-%s\" to Service {" % (agent_info["zone"])
print " parent_host_name = \"%s\"" % (agent_info["zone"])
- print " assign where service.@zone == \"%s\"" % (agent_info["zone"])
+ print " assign where service.zone == \"%s\"" % (agent_info["zone"])
print "}"
print ""
- print "zone \"%s\" {" % (agent_info["zone"])
-
for host, services in agent_info["repository"].items():
if host != agent_info["zone"]:
print "object Host \"%s\" {" % (host)
print " check_command = \"dummy\""
+ print " zone = \"%s\"" % (agent_info["zone"])
print "}"
print ""
print "object Service \"%s\" {" % (service)
print " check_command = \"dummy\""
print " host_name = \"%s\"" % (host)
+ print " zone = \"%s\"" % (agent_info["zone"])
print "}"
print ""
ignore return T_IGNORE;
__function return T_FUNCTION;
__return return T_RETURN;
-zone return T_ZONE;
__for return T_FOR;
\<\< { yylval->op = &Expression::OpShiftLeft; return T_SHIFT_LEFT; }
\>\> { yylval->op = &Expression::OpShiftRight; return T_SHIFT_RIGHT; }
%token T_IGNORE "ignore (T_IGNORE)"
%token T_FUNCTION "function (T_FUNCTION)"
%token T_RETURN "return (T_RETURN)"
-%token T_ZONE "zone (T_ZONE)"
%token T_FOR "for (T_FOR)"
%type <text> identifier
| statements statement
;
-statement: type | zone | include | include_recursive | library | constant
+statement: type | include | include_recursive | library | constant
{
m_StatementNum++;
}
}
;
-zone: T_ZONE rterm sep
- {
- Expression::Ptr aexpr = *$2;
- delete $2;
-
- if (!context->GetZone().IsEmpty())
- BOOST_THROW_EXCEPTION(std::invalid_argument("Zone name cannot be changed once it's been set."));
-
- if (m_StatementNum != 0)
- BOOST_THROW_EXCEPTION(std::invalid_argument("'zone' directive must be the first statement in a file."));
-
- context->SetZone(aexpr->Evaluate(m_ModuleScope));
- }
- | T_ZONE rterm
- {
- Expression::Ptr aexpr = *$2;
- delete $2;
-
- if (!context->GetZone().IsEmpty())
- BOOST_THROW_EXCEPTION(std::invalid_argument("Zone name cannot be changed once it's been set."));
-
- context->SetZone(aexpr->Evaluate(m_ModuleScope));
- }
- rterm_scope sep
- {
- Expression::Ptr ascope = *$4;
- delete $4;
-
- try {
- ascope->Evaluate(m_ModuleScope);
- context->SetZone(String());
- } catch (...) {
- context->SetZone(String());
- }
- }
- ;
-
include: T_INCLUDE rterm sep
{
Expression::Ptr aexpr = *$2;