Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/152#discussion_r64229699
--- Diff:
core/src/main/java/org/apache/brooklyn/core/sensor/password/CreatePasswordSensor.java
---
@@ -33,23 +34,21 @@
public static final ConfigKey<String> ACCEPTABLE_CHARS =
ConfigKeys.newStringConfigKey("password.chars", "The characters allowed in
password");
- private Integer passwordLength;
- private String acceptableChars;
-
public CreatePasswordSensor(Map<String, String> params) {
this(ConfigBag.newInstance(params));
}
public CreatePasswordSensor(ConfigBag params) {
super(params);
- passwordLength = params.get(PASSWORD_LENGTH);
- acceptableChars = params.get(ACCEPTABLE_CHARS);
}
@Override
public void apply(EntityLocal entity) {
super.apply(entity);
+ Integer passwordLength = EntityInitializers.resolve(params,
PASSWORD_LENGTH);
+ String acceptableChars = EntityInitializers.resolve(params,
ACCEPTABLE_CHARS);
--- End diff --
`apply` is called before managing any of the entities in the spec hierarchy
(i.e. a camp plan) so this can't be resolved at this point. It would just block
app creation. Could you add some tests to prove me wrong :).
`StaticSensor` does the right thing by pushing all of it in tasks.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---