mirror of
				https://github.com/Icinga/icinga2.git
				synced 2025-10-31 03:03:52 +01:00 
			
		
		
		
	Make sure that 'icinga2 console' serializes temporary attributes (rather than just config + state)
fixes #8690
This commit is contained in:
		
							parent
							
								
									442078f5ac
								
							
						
					
					
						commit
						5e39fbbdf5
					
				| @ -30,11 +30,13 @@ | |||||||
| namespace icinga | namespace icinga | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
|  | /* keep this in sync with tools/mkclass/classcompiler.hpp */ | ||||||
| enum FieldAttribute | enum FieldAttribute | ||||||
| { | { | ||||||
| 	FAConfig = 1, | 	FAEphemeral = 1, | ||||||
| 	FAState = 2, | 	FAConfig = 2, | ||||||
| 	FAInternal = 32 | 	FAState = 4, | ||||||
|  | 	FAInternal = 64, | ||||||
| };  | };  | ||||||
| 
 | 
 | ||||||
| class Type; | class Type; | ||||||
|  | |||||||
| @ -655,7 +655,7 @@ void LivestatusQuery::ExecuteScriptHelper(const Stream::Ptr& stream) | |||||||
| 		throw; | 		throw; | ||||||
| 	} | 	} | ||||||
| 	delete expr; | 	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) | void LivestatusQuery::ExecuteErrorHelper(const Stream::Ptr& stream) | ||||||
|  | |||||||
| @ -256,6 +256,9 @@ class_field: field_attribute_list identifier identifier alternative_name_specifi | |||||||
| 
 | 
 | ||||||
| 		field->Attributes = $1; | 		field->Attributes = $1; | ||||||
| 
 | 
 | ||||||
|  | 		if ((field->Attributes & (FAConfig | FAState)) == 0) | ||||||
|  | 			field->Attributes |= FAEphemeral; | ||||||
|  | 
 | ||||||
| 		field->Type = $2; | 		field->Type = $2; | ||||||
| 		std::free($2); | 		std::free($2); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -55,16 +55,18 @@ struct FieldAccessor | |||||||
| 	{ } | 	{ } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | /* keep this in sync with lib/base/type.hpp */ | ||||||
| enum FieldAttribute | enum FieldAttribute | ||||||
| { | { | ||||||
| 	FAConfig = 1, | 	FAEphemeral = 1, | ||||||
| 	FAState = 2, | 	FAConfig = 2, | ||||||
| 	FAEnum = 4, | 	FAState = 4, | ||||||
| 	FAGetProtected = 8, | 	FAEnum = 8, | ||||||
| 	FASetProtected = 16, | 	FAGetProtected = 16, | ||||||
| 	FAInternal = 32, | 	FASetProtected = 32, | ||||||
| 	FANoStorage = 64, | 	FAInternal = 64, | ||||||
| 	FALoadDependency = 128 | 	FANoStorage = 128, | ||||||
|  | 	FALoadDependency = 256 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| struct Field | struct Field | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user