+ if (_aclsCreated) {
+ IpAddress addr(_ip.c_str());
+ if (!addr.valid()) {
+ logger << "Switch::~Switch() - ivalid switch ip: '" << _ip << "'" << std::endl;
+ return;
+ }
+
+ CTarget target(addr, _readCommunity.c_str(), _writeCommunity.c_str());
+ if (!target.valid()) {
+ logger << "Switch::~Switch() - failed to create target for the switch '" << _ip << "'" << std::endl;
+ return;
+ }
+
+ target.set_version(version2c);
+
+ if (!checkProfiles(target)) {
+ logger << "Switch::~Switch() - no upload and download profiles defined for the switch '" << _ip << "'" << std::endl;
+ return;
+ }
+
+ if (!dropACLs(target)) {
+ logger << "Switch::~Switch() - failed to drop ACLs for the switch '" << _ip << "'" << std::endl;
+ return;
+ }
+ }