From 085f924b25452a82766bfff79a1eff27d974b5bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Acun=CC=83a?= Date: Tue, 31 Oct 2017 11:23:45 -0300 Subject: [PATCH 1/2] Other device type fix for linux --- lib/agent/providers/hardware/linux.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/agent/providers/hardware/linux.js b/lib/agent/providers/hardware/linux.js index e85bf7950..a4341f178 100644 --- a/lib/agent/providers/hardware/linux.js +++ b/lib/agent/providers/hardware/linux.js @@ -26,6 +26,8 @@ var data_fields = { } }; +var valid_types = ['Desktop', 'Laptop', 'Tablet']; + exports.get_firmware_info = function(callback) { var get_value = function(output, string) { @@ -48,8 +50,11 @@ exports.get_firmware_info = function(callback) { Object.keys(fields).map(function(key) { var val = get_value(stdout, fields[key]); - if (val) + if (val) { + if (key == 'device_type' && valid_types.indexOf(val) == -1) + val = 'Laptop'; data[key] = val.trim(); + } }); done(); From f96d09101a2a0ebb20d43bbba5604041760266a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Acun=CC=83a?= Date: Tue, 31 Oct 2017 11:46:25 -0300 Subject: [PATCH 2/2] Changelog modif --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 660f9c647..a5d536eba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ **Merged pull requests:** +- Device type fix for linux [\#338](https://github.com/prey/prey-node-client/pull/338) ([javo](https://github.com/javo)) - Prey user watcher for mac [\#332](https://github.com/prey/prey-node-client/pull/332) ([javo](https://github.com/javo)) - Ubuntu fixed hardware info [\#334](https://github.com/prey/prey-node-client/pull/334) ([javo](https://github.com/javo)) - Over 10 MB files wipe error fix [\#335](https://github.com/prey/prey-node-client/pull/335) ([javo](https://github.com/javo))