From 661ed3c406df3e87282814d177c851572776d712 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 15 Nov 2012 08:17:13 +0000 Subject: Throw an exception if we attempt to redefine a macro. --- lib/custodian/parser.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/custodian') diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb index 7ed7a51..268dd3b 100755 --- a/lib/custodian/parser.rb +++ b/lib/custodian/parser.rb @@ -190,6 +190,10 @@ class MonitorConfig end + if ( is_macro?( name ) ) + raise ArgumentError, "The macro #{name} is already defined" + end + @MACROS[name] = val end -- cgit v1.2.1