summaryrefslogtreecommitdiffstats
path: root/network/network.cpp
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2019-09-11 23:55:25 +0200
committerraquel medina <raquel.medina@konsulko.com>2019-09-25 07:35:38 +0000
commit45ed097db45ee0a88d3acd274f242ed100274d47 (patch)
tree59e8e70ec71fba552ea93fff4bee05a968198d22 /network/network.cpp
parent18dde87f580d41f6743b64b824b55d68df81aff1 (diff)
network: fix arguments on set_properties callshalibut_8.0.2halibut/8.0.28.0.2
Update set_properties method arguments to match agl-service-network binding expectations. Bug-AGL: SPEC-2676 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I4e4c1c633193270ad14a517fd33eff6bf26b00d3 (cherry picked from commit 8bcc689eb4d31ecbbcf050cb5af32e8e72624732)
Diffstat (limited to 'network/network.cpp')
-rw-r--r--network/network.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/network/network.cpp b/network/network.cpp
index f7baf06..c497c29 100644
--- a/network/network.cpp
+++ b/network/network.cpp
@@ -105,7 +105,7 @@ void Network::input(int id, QString passphrase)
void Network::configureAddress(QString service, QVariantList paramlist)
{
NetworkMessage *nmsg = new NetworkMessage();
- QJsonObject parameter, properties;
+ QJsonObject parameter, type, properties;
QJsonArray values = QJsonArray::fromVariantList(paramlist);
if (values.isEmpty() || values.count() < 4) {
@@ -117,7 +117,8 @@ void Network::configureAddress(QString service, QVariantList paramlist)
properties.insert("address", values[1]);
properties.insert("netmask", values[2]);
properties.insert("gateway", values[3]);
- parameter.insert("properties", properties);
+ type.insert("ipv4.configuration", properties);
+ parameter.insert("properties", type);
parameter.insert("service", service);
nmsg->createRequest("set_property", parameter);
@@ -136,10 +137,12 @@ void Network::configureNameServer(QString service, QVariantList paramlist)
return;
}
- parameter.insert("service", service);
- properties.insert("method", values[0]);
- properties.insert("nameservers", values[1]);
+ QStringList nslist = values[1].toString().split(' ');
+ QJsonArray nameservers = QJsonArray::fromStringList(nslist);
+
+ properties.insert("nameservers.configuration", nameservers);
parameter.insert("properties", properties);
+ parameter.insert("service", service);
nmsg->createRequest("set_property", parameter);
m_mloop->sendMessage(nmsg);