mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 12:14:44 +02:00
Fix a couple of wrong white spaces
This commit is contained in:
parent
57179f3bdd
commit
f7b5aa33ce
@ -162,4 +162,4 @@ void ApiClient::ObjectsHttpCompletionCallback(HttpRequest& request,
|
|||||||
}
|
}
|
||||||
|
|
||||||
callback(objects);
|
callback(objects);
|
||||||
}
|
}
|
||||||
|
@ -121,15 +121,15 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
|
|||||||
bool updated_original_attributes = false;
|
bool updated_original_attributes = false;
|
||||||
|
|
||||||
Type::Ptr type = GetReflectionType();
|
Type::Ptr type = GetReflectionType();
|
||||||
|
|
||||||
std::vector<String> tokens;
|
std::vector<String> tokens;
|
||||||
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
|
boost::algorithm::split(tokens, attr, boost::is_any_of("."));
|
||||||
|
|
||||||
String fieldName = tokens[0];
|
String fieldName = tokens[0];
|
||||||
|
|
||||||
int fid = type->GetFieldId(fieldName);
|
int fid = type->GetFieldId(fieldName);
|
||||||
Field field = type->GetFieldInfo(fid);
|
Field field = type->GetFieldInfo(fid);
|
||||||
|
|
||||||
Value oldValue = GetField(fid);
|
Value oldValue = GetField(fid);
|
||||||
|
|
||||||
if (field.Attributes & FAConfig) {
|
if (field.Attributes & FAConfig) {
|
||||||
@ -143,25 +143,25 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
|
|||||||
original_attributes->Set(attr, oldValue);
|
original_attributes->Set(attr, oldValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Value newValue;
|
Value newValue;
|
||||||
|
|
||||||
if (tokens.size() > 1) {
|
if (tokens.size() > 1) {
|
||||||
newValue = oldValue.Clone();
|
newValue = oldValue.Clone();
|
||||||
Value current = newValue;
|
Value current = newValue;
|
||||||
|
|
||||||
if (current.IsEmpty()) {
|
if (current.IsEmpty()) {
|
||||||
current = new Dictionary();
|
current = new Dictionary();
|
||||||
newValue = current;
|
newValue = current;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (std::vector<String>::size_type i = 1; i < tokens.size() - 1; i++) {
|
for (std::vector<String>::size_type i = 1; i < tokens.size() - 1; i++) {
|
||||||
if (!current.IsObjectType<Dictionary>())
|
if (!current.IsObjectType<Dictionary>())
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
|
||||||
|
|
||||||
Dictionary::Ptr dict = current;
|
Dictionary::Ptr dict = current;
|
||||||
const String& key = tokens[i];
|
const String& key = tokens[i];
|
||||||
|
|
||||||
if (!dict->Contains(key)) {
|
if (!dict->Contains(key)) {
|
||||||
current = new Dictionary();
|
current = new Dictionary();
|
||||||
dict->Set(key, current);
|
dict->Set(key, current);
|
||||||
@ -169,13 +169,13 @@ void ConfigObject::ModifyAttribute(const String& attr, const Value& value, bool
|
|||||||
current = dict->Get(key);
|
current = dict->Get(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!current.IsObjectType<Dictionary>())
|
if (!current.IsObjectType<Dictionary>())
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Value must be a dictionary."));
|
||||||
|
|
||||||
Dictionary::Ptr dict = current;
|
Dictionary::Ptr dict = current;
|
||||||
const String& key = tokens[tokens.size() - 1];
|
const String& key = tokens[tokens.size() - 1];
|
||||||
|
|
||||||
dict->Set(key, value);
|
dict->Set(key, value);
|
||||||
} else
|
} else
|
||||||
newValue = value;
|
newValue = value;
|
||||||
@ -259,7 +259,7 @@ void ConfigObject::Activate(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetAuthority(true);
|
SetAuthority(true);
|
||||||
|
|
||||||
NotifyActive();
|
NotifyActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,4 +137,4 @@ void ObjectListCommand::PrintTypeCounts(std::ostream& fp, const std::map<String,
|
|||||||
|
|
||||||
fp << ".\n";
|
fp << ".\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -151,4 +151,4 @@ void ObjectListUtility::PrintArray(std::ostream& fp, const Array::Ptr& arr)
|
|||||||
fp << " ";
|
fp << " ";
|
||||||
|
|
||||||
fp << "]";
|
fp << "]";
|
||||||
}
|
}
|
||||||
|
@ -231,4 +231,4 @@ size_t HttpResponse::ReadBody(char *data, size_t count)
|
|||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return m_Body->Read(data, count, true);
|
return m_Body->Read(data, count, true);
|
||||||
}
|
}
|
||||||
|
@ -250,4 +250,4 @@ die:
|
|||||||
if (phQuery)
|
if (phQuery)
|
||||||
PdhCloseQuery(phQuery);
|
PdhCloseQuery(phQuery);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -213,4 +213,4 @@ INT check_memory(printInfoStruct& printInfo)
|
|||||||
delete pMemBuf;
|
delete pMemBuf;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -400,4 +400,4 @@ VOID FormatPDHError(PDH_STATUS status)
|
|||||||
|
|
||||||
std::wcout << pMessage << '\n';
|
std::wcout << pMessage << '\n';
|
||||||
LocalFree(pMessage);
|
LocalFree(pMessage);
|
||||||
}
|
}
|
||||||
|
@ -444,4 +444,4 @@ die:
|
|||||||
delete reinterpret_cast<VOID *>(repBuf);
|
delete reinterpret_cast<VOID *>(repBuf);
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -206,4 +206,4 @@ INT check_swap(printInfoStruct& printInfo)
|
|||||||
printInfo.aSwap = round(MemBuf.ullAvailPageFile / pow(1024.0, printInfo.unit));
|
printInfo.aSwap = round(MemBuf.ullAvailPageFile / pow(1024.0, printInfo.unit));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -249,4 +249,4 @@ die:
|
|||||||
if (criteria)
|
if (criteria)
|
||||||
SysFreeString(criteria);
|
SysFreeString(criteria);
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -216,4 +216,4 @@ VOID getUptime(printInfoStruct& printInfo)
|
|||||||
printInfo.time = uptime.count();
|
printInfo.time = uptime.count();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,4 +232,4 @@ INT check_users(printInfoStruct& printInfo)
|
|||||||
WTSFreeMemory(pSessionInfo);
|
WTSFreeMemory(pSessionInfo);
|
||||||
printInfo.users = users;
|
printInfo.users = users;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -226,4 +226,4 @@ VOID die(DWORD err)
|
|||||||
std::wcout << "Failed to format error message, last error was: " << err << '\n';
|
std::wcout << "Failed to format error message, last error was: " << err << '\n';
|
||||||
else
|
else
|
||||||
std::wcout << mBuf << std::endl;
|
std::wcout << mBuf << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user