Pick up the augeas RuntimeError and pass the correct one

This commit is contained in:
Joona Hoikkala 2016-01-14 00:06:52 +02:00
parent 99c575f043
commit 30ad7dce9f

View file

@ -180,8 +180,11 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
regexp matching"""
self.aug.set("/test/path/testing/arg", "aRgUMeNT")
matches = self.aug.match(
"/test//*[self::arg=~regexp('argument', 'i')]")
try:
matches = self.aug.match(
"/test//*[self::arg=~regexp('argument', 'i')]")
except RuntimeError:
return None
self.aug.remove("/test/path")
return matches