Commit Graph

22 Commits

Author SHA1 Message Date
Thomas Gelf ee247ab383 test/php: provide DB mostly everwhere...
...as template repository would otherwise complain. Also, fit new boolean
true rendering
2017-08-26 16:17:55 +02:00
Thomas Gelf da41e2f4db AssignRenderer: improve/separate in-related code
fixes #844
2017-03-13 22:25:04 +01:00
Thomas Gelf a48e0c6dda AssignRenderer: test and fix contains rendering
fixes #803
2017-03-06 11:10:24 +01:00
Thomas Gelf 5842e40fb6 AssignRenderer: do not re-use json-encoded value
...as encoding in Icinga 2 differs

fixes #558
2017-03-03 09:24:15 +01:00
Thomas Gelf 9e771f2d5a Fix phpcs complaints 2017-01-13 19:47:54 +01:00
Thomas Gelf b7eaab715b Make explicit calls to renderStringWithVariables 2016-10-22 05:48:09 +00:00
Corentin Ardeois 37c91050c7 Expressions syntax is now $var$
Instead of $$var$$.
We make sure $$var$$ is left untouched.

refs #11976
2016-10-22 00:15:09 +00:00
Corentin Ardeois ddcfb09f58 Handle expressions only for apply objects
Expressions will be handled only if the object is an ApplyRule.
Only properties and custom variables are replaced.

refs #11976
2016-10-22 00:15:09 +00:00
Corentin Ardeois bcef87f4c9 Add support for expressions
Any rendered string can contain variables encapsulated with "$$" characters.

Example:
Display Name declared with `Port $$host.vars.tcp_port$$ check` will
be processed as `"Port " + host.vars.tcp_port + " check"`

API:
```bash
 ./director-curl POST director/service?name=my_service '{"display_name": "Port $$host.vars.tcp_port$$ check" }'
 ```

 Rendered config:
 ```
  apply Service "my_service" {
      import "my_template"

      display_name = "Port " + host.vars.tcp_port + " check"
  }
 ```

refs #11976
2016-10-22 00:15:09 +00:00
Thomas Gelf 4cd399e059 IcingaConfigHelper: use string-based sort for...
...dictionary fields to make PHP 5.x and PHP 7.x produce the same output.

refs #12591
2016-09-07 20:44:03 +00:00
Thomas Gelf 6427b22621 IcingaConfigHelper: fix numeric dictionary key...
...rendering and add related tests

fixes #12591
2016-08-30 12:15:48 +00:00
Thomas Gelf a80aed49a1 StateFilterTest: a couple of tests for state filters 2016-03-01 04:28:26 +01:00
Thomas Gelf 4b46330855 ExtensibleSet: do not quote values, adjust tests 2016-02-29 18:30:32 +01:00
Thomas Gelf 245e632f54 ExtensibleSet: fix tests 2016-02-29 17:37:01 +01:00
Thomas Gelf cc70193a56 ExtensibleSet: add and test renderer 2016-02-29 12:38:31 +01:00
Thomas Gelf 23dd4721ec ExtensibleSet: basic implementation & tests 2016-02-29 12:23:08 +01:00
Thomas Gelf 11e5ef0362 IcingaConfigHelper: empty intervals are null 2016-02-28 16:27:06 +01:00
Thomas Gelf 4dde0eaaf6 IcingaConfigHelper: Icinga2 doesn't support 2m 30s 2016-02-28 13:55:16 +01:00
Thomas Gelf 255acf2fd5 IcingaConfigHelperTest: add duration format tests 2016-02-28 13:25:49 +01:00
Thomas Gelf f2a1ec91f7 test/php: allow to skip tests with db-dependency 2016-02-26 12:01:00 +01:00
Thomas Gelf c32fe0a3bb AssignRendererTest: add more test cases 2016-02-25 20:11:39 +01:00
Thomas Gelf c741042108 AssignRendererTest: first new simple test 2016-02-25 18:24:17 +01:00