Commit 7ef49b15 authored by fionera's avatar fionera

Added very ugly hack for removing the " Char

parent f44ebd78
......@@ -31,7 +31,7 @@ exports.form = function (req, res) {
res.redirect("/db");
}
} else if (action == "remove") {
console.log("remove mac request mac: "+mac + " label " + '"' + label + '"' + " ip: " + ip);
console.log("remove mac request mac: "+mac + " label " + label + " ip: " + ip);
snmpMac.delete(mac, function (err) {
console.log("delete mac result: " + err);
req.flash('status', err == null ? "" : "database error: " + err);
......
......@@ -62,7 +62,15 @@ var SnmpMac = function(hostname, community) {
// console.log(mac);
redisClient.get(redisprefix + mac, function(err, reply) {
if(reply != null) {
names.push(reply);
if (reply.split('')[0] == '"' && reply.split('')[reply.split('').length] == '"') {
var name = "";
for (var i = 1; i < reply.split('').length - 1; i++){
name += reply.split('')[i]
}
names.push()
} else {
names.push(reply);
}
}
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment