This bug reported a sysconfig agent crash due to an unhandled exception
when the is_postboot_configured property was set to an incompatible
value (string instead of an int).
Upon further inspection, the way this property was getting set didn't
make a lot of sense to me. I proposed removing the property completely
in favor of just using the is_configured method, but beekhof made a good
point that you can't filter on the result of a method call.
Instead of trying to define when is_postboot_configured should be set
inside of Matahari, let that be "business logic" and just get set by the
application using the Matahari APIs.
Signed-off-by: Russell Bryant <rbryant(a)redhat.com>
---
src/sysconfig/schema.xml | 10 +++++++++-
src/sysconfig/sysconfig-qmf.cpp | 1 -
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/sysconfig/schema.xml b/src/sysconfig/schema.xml
index 24197c6..b03cc25 100644
--- a/src/sysconfig/schema.xml
+++ b/src/sysconfig/schema.xml
@@ -4,7 +4,15 @@
<class name="Sysconfig">
<property name="uuid" type="sstr"
access="RO" desc="Host UUID" />
<property name="hostname" type="sstr"
access="RO" desc="Hostname" index="y"/>
- <property name="is_postboot_configured" type="uint32"
access="RO" desc="Check if agent is configured." />
+ <!--
+ It is useful to have some information in a property since you can
+ filter on properties. This property is intended to be used as a
+ flag to know whether or not initial configuration of a host has
+ been done or not. It is not automatically set. Once the
+ configuring entity has completed its tasks, it should set this
+ property itself.
+ -->
+ <property name="is_postboot_configured" type="uint32"
access="RW" desc="Set if agent is configured." />
<statistic name="qmf-gen-no-crash" type="absTime"
desc="Dummy stat to stop qmf-gen from crashing." />
diff --git a/src/sysconfig/sysconfig-qmf.cpp b/src/sysconfig/sysconfig-qmf.cpp
index 442d27a..d5b007c 100644
--- a/src/sysconfig/sysconfig-qmf.cpp
+++ b/src/sysconfig/sysconfig-qmf.cpp
@@ -109,7 +109,6 @@ ConfigAgent::invoke(qmf::AgentSession session, qmf::AgentEvent event,
gpointer u
event.addReturnArgument("query", data);
} else if (methodName == "is_configured") {
status = mh_sysconfig_is_configured(args["key"].asString().c_str());
- _instance.setProperty("is_postboot_configured", status);
event.addReturnArgument("status", status);
} else {
session.raiseException(event, MH_NOT_IMPLEMENTED);
--
1.7.6