Skip to content
This repository
Browse code

Fix : if custom macro was like _HOST it get stripped.

  • Loading branch information...
commit 4e9ca47716fae0e2ecc8c8df3b907f4eb753fb5c 1 parent c4a2b9f
Gabès Jean authored October 02, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  shinken/macroresolver.py
3  shinken/macroresolver.py
@@ -208,7 +208,8 @@ def resolve_simple_macros_in_string(self, c_line, data, args=None):
208 208
                                 macros[macro]['val'] = self._delete_unwanted_caracters(macros[macro]['val'])
209 209
                 if macros[macro]['type'] == 'CUSTOM':
210 210
                     cls_type = macros[macro]['class']
211  
-                    macro_name = re.split('_' + cls_type, macro)[1].upper()
  211
+                    # Beware : only cut the frst _HOST value, so the macro name can have it on it...
  212
+                    macro_name = re.split('_' + cls_type, macro, 1)[1].upper()
212 213
                     # Ok, we've got the macro like MAC_ADDRESS for _HOSTMAC_ADDRESS
213 214
                     # Now we get the element in data that have the type HOST
214 215
                     # and we check if it gots the custom value

0 notes on commit 4e9ca47

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