From ee572ccd359ca6ff63abfdec72fc8fd8399326d9 Mon Sep 17 00:00:00 2001
From: Iiro Rastas <iitara@utu.fi>
Date: Mon, 16 Dec 2019 16:01:04 +0200
Subject: [PATCH] Rename getSlaves() to getControllers()

---
 applications/gui/src/ctrl_window.cpp              | 2 +-
 applications/gui/src/screen.cpp                   | 2 +-
 components/control/cpp/include/ftl/master.hpp     | 2 +-
 components/control/cpp/src/master.cpp             | 2 +-
 components/net/cpp/test/net_configurable_unit.cpp | 8 ++++----
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/applications/gui/src/ctrl_window.cpp b/applications/gui/src/ctrl_window.cpp
index fc82c4583..3681022bd 100644
--- a/applications/gui/src/ctrl_window.cpp
+++ b/applications/gui/src/ctrl_window.cpp
@@ -121,7 +121,7 @@ void ControlWindow::_addNode() {
 }
 
 void ControlWindow::_updateDetails() {
-	node_details_ = ctrl_->getSlaves();
+	node_details_ = ctrl_->getControllers();
 
 	node_titles_.clear();
 	for (auto &d : node_details_) {
diff --git a/applications/gui/src/screen.cpp b/applications/gui/src/screen.cpp
index d0d994421..77c4e4318 100644
--- a/applications/gui/src/screen.cpp
+++ b/applications/gui/src/screen.cpp
@@ -244,7 +244,7 @@ ftl::gui::Screen::Screen(ftl::Configurable *proot, ftl::net::Universe *pnet, ftl
 	//net_->onConnect([this,popup](ftl::net::Peer *p) {
 	{
 		LOG(INFO) << "NET CONNECT";
-		auto node_details = ctrl_->getSlaves();
+		auto node_details = ctrl_->getControllers();
 
 		for (auto &d : node_details) {
 			LOG(INFO) << "ADDING TITLE: " << d.dump();
diff --git a/components/control/cpp/include/ftl/master.hpp b/components/control/cpp/include/ftl/master.hpp
index 15d27ab95..641dfa756 100644
--- a/components/control/cpp/include/ftl/master.hpp
+++ b/components/control/cpp/include/ftl/master.hpp
@@ -50,7 +50,7 @@ class Master {
 
 	std::vector<std::string> getConfigurables(const ftl::UUID &peer);
 
-	std::vector<ftl::config::json_t> getSlaves();
+	std::vector<ftl::config::json_t> getControllers();
 
 	std::vector<ftl::config::json_t> get(const std::string &uri);
 
diff --git a/components/control/cpp/src/master.cpp b/components/control/cpp/src/master.cpp
index d59b61b85..13bf86157 100644
--- a/components/control/cpp/src/master.cpp
+++ b/components/control/cpp/src/master.cpp
@@ -131,7 +131,7 @@ void Master::set(const ftl::UUID &peer, const string &uri, const json_t &value)
 	net_->send(peer, "update_cfg", uri, value.dump());
 }
 
-vector<json_t> Master::getSlaves() {
+vector<json_t> Master::getControllers() {
 	auto response = net_->findAll<string>("node_details");
 	vector<json_t> result;
 	for (auto &r : response) {
diff --git a/components/net/cpp/test/net_configurable_unit.cpp b/components/net/cpp/test/net_configurable_unit.cpp
index 9452f7cea..e3fef1444 100644
--- a/components/net/cpp/test/net_configurable_unit.cpp
+++ b/components/net/cpp/test/net_configurable_unit.cpp
@@ -14,7 +14,7 @@ SCENARIO( "NetConfigurable::set()" ) {
         net->start();
         ftl::ctrl::Master *controller = new ftl::ctrl::Master(root, net);
         
-        // Set up a slave, then call getSlaves() to get the UUID string
+        // Set up a slave, then call getControllers() to get the UUID string
         nlohmann::json jsonSlave = {{"$id", "slave"}, {"test", {{"peers", {"tcp://localhost:7077"}}}}};
         ftl::Configurable *rootSlave;
         rootSlave = new ftl::Configurable(jsonSlave);
@@ -24,10 +24,10 @@ SCENARIO( "NetConfigurable::set()" ) {
         netSlave->waitConnections();
         net->waitConnections();
 
-        auto slaves = controller->getSlaves();
-        REQUIRE( slaves.size() == 1 );
+        auto controllers = controller->getControllers();
+        REQUIRE( controllers.size() == 1 );
 
-        ftl::UUID peer = ftl::UUID(slaves[0]["id"].get<std::string>());
+        ftl::UUID peer = ftl::UUID(controllers[0]["id"].get<std::string>());
         const std::string suri = "slave_test";
         nlohmann::json jsonTest = {{"$id", "slave_test"}, {"test", {{"peers", {"tcp://localhost:7077"}}}}};
         NetConfigurable nc(peer, suri, *controller, jsonTest);
-- 
GitLab