Skip to content

Commit

Permalink
Remove deprecations
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero committed Jul 28, 2023
1 parent 5f04256 commit e468a0c
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 168 deletions.
7 changes: 0 additions & 7 deletions include/gz/transport/CIface.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ extern "C" {
/// \brief A transport node.
typedef struct GzTransportNode GzTransportNode;

// TODO(CH3): Deprecated. Remove!
#ifdef _WIN32
using IgnTransportNode = GzTransportNode;
#else
using IgnTransportNode GZ_DEPRECATED(12) = GzTransportNode;
#endif

/// \brief Create a transport node.
/// \param[in] _partition Optional name of the partition to use.
/// Use nullptr to use the default value, which is specified via the
Expand Down
23 changes: 0 additions & 23 deletions include/gz/transport/Discovery.hh
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ namespace gz
{
this->hostInterfaces = {gzIp};
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_IP", gzIp) && !gzIp.empty())
{
std::cerr << "IGN_IP is deprecated and will be removed! "
<< "Use GZ_IP instead!" << std::endl;
this->hostInterfaces = {gzIp};
}
else
{
// Get the list of network interfaces in this host.
Expand Down Expand Up @@ -246,13 +239,6 @@ namespace gz
{
relays = transport::split(gzRelay, ':');
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_RELAY", gzRelay) && !gzRelay.empty())
{
std::cout << "IGN_RELAY is deprecated and will be removed! "
<< "Use GZ_RELAY instead!" << std::endl;
relays = transport::split(gzRelay, ':');
}

// Register all unicast relays.
for (auto const &relayAddr : relays)
Expand Down Expand Up @@ -1373,15 +1359,6 @@ namespace gz
{
topicStats = (gzStats == "1");
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_TRANSPORT_TOPIC_STATISTICS", gzStats)
&& !gzStats.empty())
{
std::cout << "IGN_TRANSPORT_TOPIC_STATISTICS is deprecated! "
<< "Use GZ_TRANSPORT_TOPIC_STATISTICS instead!"
<< std::endl;
topicStats = (gzStats == "1");
}

return this->kWireVersion + (topicStats * 100);
}
Expand Down
5 changes: 0 additions & 5 deletions include/gz/transport/NodeShared.hh
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ namespace gz
const std::string &_msgData,
const HandlerInfo &_handlerInfo);

/// \brief Method in charge of receiving the control updates (when a new
/// remote subscriber notifies its presence for example).
/// ToDo: Remove this function when possible.
public: void RecvControlUpdate();

/// \brief Method in charge of receiving the service call requests.
public: void RecvSrvRequest();

Expand Down
4 changes: 0 additions & 4 deletions log/include/gz/transport/log/Log.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ namespace gz
/// \brief Name of Environment variable containing path to schema
const std::string SchemaLocationEnvVar = "GZ_TRANSPORT_LOG_SQL_PATH";

// TODO(CH3): Deprecated. Remove this on ticktock.
const std::string SchemaLocationEnvVarDeprecated = \
"IGN_TRANSPORT_LOG_SQL_PATH";

/// \brief Interface to a log file
class GZ_TRANSPORT_LOG_VISIBLE Log
{
Expand Down
14 changes: 0 additions & 14 deletions log/src/Log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,20 +445,6 @@ bool Log::Open(const std::string &_file, const std::ios_base::openmode _mode)
std::string schemaFile;
const char *envPath = std::getenv(SchemaLocationEnvVar.c_str());

// TODO(CH3): Deprecated. Remove this on ticktock.
if (!(envPath))
{
envPath = std::getenv(SchemaLocationEnvVarDeprecated.c_str());

if ((envPath))
{
LWRN("Found schema using deprecated environment variable ["
<< SchemaLocationEnvVarDeprecated.c_str()
<< "]. Please use [" << SchemaLocationEnvVar.c_str()
<< "] instead.");
}
}

if (envPath)
{
schemaFile = envPath;
Expand Down
4 changes: 0 additions & 4 deletions log/test/integration/playback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,6 @@ int main(int argc, char **argv)
setenv("GZ_TRANSPORT_LOG_SQL_PATH",
GZ_TRANSPORT_LOG_SQL_PATH, 1);

// TODO(CH3): Deprecated. Remove this on tick-tock.
setenv("IGN_TRANSPORT_LOG_SQL_PATH",
GZ_TRANSPORT_LOG_SQL_PATH, 1);

setenv(gz::transport::log::SchemaLocationEnvVar.c_str(),
GZ_TRANSPORT_LOG_SQL_PATH, 1);

Expand Down
4 changes: 0 additions & 4 deletions log/test/integration/recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@ int main(int argc, char **argv)
setenv("GZ_TRANSPORT_LOG_SQL_PATH",
GZ_TRANSPORT_LOG_SQL_PATH, 1);

// TODO(CH3): Deprecated. Remove this on tick-tock.
setenv("IGN_TRANSPORT_LOG_SQL_PATH",
GZ_TRANSPORT_LOG_SQL_PATH, 1);

setenv(gz::transport::log::SchemaLocationEnvVar.c_str(),
GZ_TRANSPORT_LOG_SQL_PATH, 1);

Expand Down
7 changes: 0 additions & 7 deletions src/NetUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,6 @@ inline namespace GZ_TRANSPORT_VERSION_NAMESPACE
{
return gzIp;
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_IP", gzIp) && !gzIp.empty())
{
std::cout << "IGN_IP is deprecated and will be removed! "
<< "Use GZ_IP instead!" << std::endl;
return gzIp;
}

// Second, try the preferred local and public IP address.
std::string hostIP;
Expand Down
7 changes: 0 additions & 7 deletions src/NodeOptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ NodeOptions::NodeOptions()
{
this->SetPartition(gzPartition);
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_PARTITION", gzPartition))
{
std::cout << "IGN_PARTITION is deprecated and will be removed! "
<< "Use GZ_PARTITION instead!" << std::endl;
this->SetPartition(gzPartition);
}
}

//////////////////////////////////////////////////
Expand Down
94 changes: 1 addition & 93 deletions src/NodeShared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,7 @@ bool userPass(std::string &_user, std::string &_pass)

if (!username || !password)
{
username = std::getenv("IGN_TRANSPORT_USERNAME");
password = std::getenv("IGN_TRANSPORT_PASSWORD");

if (!username || !password)
{
return false;
}
// TODO(CH3): Deprecated. Remove on tock.
else
{
std::cerr << "IGN_TRANSPORT_USERNAME and IGN_TRANSPORT_PASSWORD "
<< " are deprecated and will be removed! Use "
<< "GZ_TRANSPORT_USERNAME and GZ_TRANSPORT_PASSWORD instead!"
<< std::endl;
}
return false;
}

_user = username;
Expand Down Expand Up @@ -220,13 +206,6 @@ NodeShared::NodeShared()
{
this->verbose = (gzVerbose == "1");
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_VERBOSE", gzVerbose) && !gzVerbose.empty())
{
std::cerr << "IGN_VERBOSE is deprecated and will be removed! "
<< "Use GZ_VERBOSE instead!" << std::endl;
this->verbose = (gzVerbose == "1");
}

// Set the multicast IP used for discovery.
std::string envDiscoveryIp;
Expand All @@ -235,50 +214,15 @@ NodeShared::NodeShared()
{
this->discoveryIP = envDiscoveryIp;
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_DISCOVERY_MULTICAST_IP", envDiscoveryIp) &&
!envDiscoveryIp.empty())
{
std::cerr << "IGN_DISCOVERY_MULTICAST_IP is deprecated! "
<< "Use GZ_DISCOVERY_MULTICAST_IP instead!" << std::endl;
this->discoveryIP = envDiscoveryIp;
}


// Set the port used for msg discovery.
this->msgDiscPort = this->dataPtr->NonNegativeEnvVar(
"GZ_DISCOVERY_MSG_PORT", this->kDefaultMsgDiscPort);

// TODO(CH3): Deprecated. Remove on tock.
if (this->msgDiscPort == this->kDefaultMsgDiscPort)
{
this->msgDiscPort = this->dataPtr->NonNegativeEnvVar(
"IGN_DISCOVERY_MSG_PORT", this->kDefaultMsgDiscPort);

if (this->msgDiscPort != this->kDefaultMsgDiscPort)
{
std::cerr << "IGN_DISCOVERY_MSG_PORT is deprecated! "
<< "Use GZ_DISCOVERY_MSG_PORT instead!" << std::endl;
}
}

// Set the port used for srv discovery.
this->srvDiscPort = this->dataPtr->NonNegativeEnvVar(
"GZ_DISCOVERY_SRV_PORT", this->kDefaultSrvDiscPort);

// TODO(CH3): Deprecated. Remove on tock.
if (this->srvDiscPort == this->kDefaultSrvDiscPort)
{
this->srvDiscPort = this->dataPtr->NonNegativeEnvVar(
"IGN_DISCOVERY_SRV_PORT", this->kDefaultSrvDiscPort);
if (this->srvDiscPort != this->kDefaultSrvDiscPort)
{
std::cerr << "IGN_DISCOVERY_SRV_PORT is deprecated! "
<< "Use GZ_DISCOVERY_SRV_PORT instead!" << std::endl;
}
}


// Sanity check: the discovery ports should be unique.
if (this->msgDiscPort == this->srvDiscPort)
{
Expand All @@ -298,13 +242,6 @@ NodeShared::NodeShared()
{
this->dataPtr->topicStatsEnabled = (gzStats == "1");
}
// TODO(CH3): Deprecated. Remove on tock.
else if (env("IGN_TRANSPORT_TOPIC_STATISTICS", gzStats) && !gzStats.empty())
{
std::cerr << "IGN_TRANSPORT_TOPIC_STATISTICS is deprecated! "
<< "Use GZ_TRANSPORT_TOPIC_STATISTICS instead!" << std::endl;
this->dataPtr->topicStatsEnabled = (gzStats == "1");
}

// My process UUID.
Uuid uuid;
Expand Down Expand Up @@ -690,11 +627,6 @@ void NodeShared::TriggerCallbacks(
}
}

//////////////////////////////////////////////////
void NodeShared::RecvControlUpdate()
{
}

//////////////////////////////////////////////////
void NodeShared::RecvSrvRequest()
{
Expand Down Expand Up @@ -1432,18 +1364,6 @@ bool NodeShared::InitializeSockets()
int rcvQueueVal = this->dataPtr->NonNegativeEnvVar(
"GZ_TRANSPORT_RCVHWM", kDefaultRcvHwm);

// TODO(CH3): Deprecated. Remove on tock.
if (rcvQueueVal == kDefaultRcvHwm)
{
rcvQueueVal = this->dataPtr->NonNegativeEnvVar(
"IGN_TRANSPORT_RCVHWM", kDefaultRcvHwm);
if (rcvQueueVal != kDefaultRcvHwm)
{
std::cerr << "IGN_TRANSPORT_RCVHWM is deprecated! "
<< "Use GZ_TRANSPORT_RCVHWM instead!" << std::endl;
}
}

#ifdef GZ_CPPZMQ_POST_4_7_0
this->dataPtr->subscriber->set(zmq::sockopt::rcvhwm, rcvQueueVal);
#else
Expand All @@ -1455,18 +1375,6 @@ bool NodeShared::InitializeSockets()
int sndQueueVal = this->dataPtr->NonNegativeEnvVar(
"GZ_TRANSPORT_SNDHWM", kDefaultSndHwm);

// TODO(CH3): Deprecated. Remove on tock.
if (sndQueueVal == kDefaultSndHwm)
{
rcvQueueVal = this->dataPtr->NonNegativeEnvVar(
"IGN_TRANSPORT_SNDHWM", kDefaultSndHwm);
if (sndQueueVal != kDefaultSndHwm)
{
std::cerr << "IGN_TRANSPORT_SNDHWM is deprecated! "
<< "Use GZ_TRANSPORT_SNDHWM instead!" << std::endl;
}
}

#ifdef GZ_CPPZMQ_POST_4_7_0
this->dataPtr->publisher->set(zmq::sockopt::sndhwm, sndQueueVal);

Expand Down

0 comments on commit e468a0c

Please sign in to comment.