]> granicus.if.org Git - icinga2/commitdiff
Make sure that 'icinga2 console' serializes temporary attributes (rather than just...
authorGunnar Beutner <gunnar@beutner.name>
Wed, 11 Mar 2015 15:06:58 +0000 (16:06 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 11 Mar 2015 15:07:24 +0000 (16:07 +0100)
fixes #8690

lib/base/type.hpp
lib/livestatus/livestatusquery.cpp
tools/mkclass/class_parser.yy
tools/mkclass/classcompiler.hpp

index fdd76d593c206ec190b49c9971d6acca818063a4..d1b2adb2762f86f876900ad42e5cf7431ab138f2 100644 (file)
 namespace icinga
 {
 
+/* keep this in sync with tools/mkclass/classcompiler.hpp */
 enum FieldAttribute
 {
-       FAConfig = 1,
-       FAState = 2,
-       FAInternal = 32
+       FAEphemeral = 1,
+       FAConfig = 2,
+       FAState = 4,
+       FAInternal = 64,
 }; 
 
 class Type;
index 9d904805ebbe8069c8f1bd17a1c1703a5da35aa3..053610bdc88aa29c36d587cd6f3faa42e391de8c 100644 (file)
@@ -655,7 +655,7 @@ void LivestatusQuery::ExecuteScriptHelper(const Stream::Ptr& stream)
                throw;
        }
        delete expr;
-       SendResponse(stream, LivestatusErrorOK, JsonEncode(Serialize(result, FAState | FAConfig), true));
+       SendResponse(stream, LivestatusErrorOK, JsonEncode(Serialize(result, FAEphemeral | FAState | FAConfig), true));
 }
 
 void LivestatusQuery::ExecuteErrorHelper(const Stream::Ptr& stream)
index 59e9147d34a9caf839fbc225e96837576142a5fc..559a9b2c59dcca261d9e238d445b8564503c9b3a 100644 (file)
@@ -256,6 +256,9 @@ class_field: field_attribute_list identifier identifier alternative_name_specifi
 
                field->Attributes = $1;
 
+               if ((field->Attributes & (FAConfig | FAState)) == 0)
+                       field->Attributes |= FAEphemeral;
+
                field->Type = $2;
                std::free($2);
 
index 28df74c00ac4c4243c41f8862a05c0489110ac37..bb53c745a8bd7775bc5e69bb2fae475115c23b2c 100644 (file)
@@ -55,16 +55,18 @@ struct FieldAccessor
        { }
 };
 
+/* keep this in sync with lib/base/type.hpp */
 enum FieldAttribute
 {
-       FAConfig = 1,
-       FAState = 2,
-       FAEnum = 4,
-       FAGetProtected = 8,
-       FASetProtected = 16,
-       FAInternal = 32,
-       FANoStorage = 64,
-       FALoadDependency = 128
+       FAEphemeral = 1,
+       FAConfig = 2,
+       FAState = 4,
+       FAEnum = 8,
+       FAGetProtected = 16,
+       FASetProtected = 32,
+       FAInternal = 64,
+       FANoStorage = 128,
+       FALoadDependency = 256
 };
 
 struct Field