Skip to content
Browse files

Generalize Linux distro detection with lsb-release

  • Loading branch information...
1 parent 2005145 commit d1b86d8d66dfbb2fc61165db4c5d1cec878fe790 Yurii Rashkovskii committed with Feb 4, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 apps/htoad/src/htoad_host.erl
View
4 apps/htoad/src/htoad_host.erl
@@ -5,15 +5,15 @@
-neg_rule({init, [{htoad_argument, {host, '__IGNORE_UNDERSCORE__'}}]}).
--rules([init, init_with_hostname_overriden, linux_ubuntu, linux_redhat]).
+-rules([init, init_with_hostname_overriden, linux_lsb, linux_redhat]).
init_with_hostname_overriden(Engine, #init{}, {htoad_argument, {host, Hostname}}) ->
initialize(Engine, Hostname).
init(Engine, #init{}) when not {rule, [{htoad_argument, {host, _}}]} ->
initialize(Engine, hostname()).
-linux_ubuntu(Engine, #file{ path="/etc/lsb-release", producer = fs, content = Content }, {operating_system_name, linux}) ->
+linux_lsb(Engine, #file{ path="/etc/lsb-release", producer = fs, content = Content }, {operating_system_name, linux}) ->
{match, [Dist]} = re:run(Content,".*DISTRIB_ID=(.*).*",[{capture,[1],list}]),
lager:debug("Detected Linux ~s", [Dist]),
htoad:assert(Engine, {linux_distribution, Dist}).

0 comments on commit d1b86d8

Please sign in to comment.
Something went wrong with that request. Please try again.