summaryrefslogtreecommitdiff
path: root/lib/custodian/util/prefix.rb
diff options
context:
space:
mode:
authorIan Chilton <ian.chilton@bytemark.co.uk>2018-02-28 13:07:54 +0000
committerIan Chilton <ian.chilton@bytemark.co.uk>2018-02-28 13:07:54 +0000
commitc42a0bef7d7194989cdacc317409fa4ac0b802a0 (patch)
treed0c759084b69d6f2220ca0265f34b9979a1c0b80 /lib/custodian/util/prefix.rb
parent25b1792c7adca856bedadbeae1fa4de7972c8b5b (diff)
parent1f3d5467758529812601111b8b4fdf2566abd3d4 (diff)
Merge branch '21-allow-custom-subjects' into 'master'
Resolve "Feature: allow specifying `with subject 'foo'` in checks to declare what the Subject should be" Closes #21 See merge request open-source/custodian!15
Diffstat (limited to 'lib/custodian/util/prefix.rb')
-rw-r--r--lib/custodian/util/prefix.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/custodian/util/prefix.rb b/lib/custodian/util/prefix.rb
deleted file mode 100644
index 743a422..0000000
--- a/lib/custodian/util/prefix.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-#
-# This class allows a custom-prefix to be prepended to any alert
-# subjects.
-#
-module Custodian
-
- module Util
-
- class Prefix
-
-
- #
- # Return the custom-prefix to use, if any.
- #
- def Prefix.text()
- # Default to no prefix.
- default = ""
-
- # Look for matches - last one wins.
- Dir.glob( "/store/clients/*/custodian-prefix.cfg" ).each do |file|
- begin
- default = File.read( file )
- rescue Errno::EACCES
- # Permission-denied.
- end
- end
-
- # Remove any newline characters
- default.gsub!( /[\r\n]/, '' )
-
- # Truncate, if required.
- max = 32
- default = default[0...max] if ( default.length > max )
-
- default
- end
-
- end
- end
-end