From 74b2588740ef66b8ed403023eb8b782981901d4d Mon Sep 17 00:00:00 2001
From: Michele Tartara <mtartara@google.com>
Date: Thu, 25 Apr 2013 08:27:48 +0000
Subject: [PATCH] Add HS functions for getting the instance reason path

The getInstReasonFilename is built to resemble the python corresponding
function.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
---
 src/Ganeti/Path.hs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/Ganeti/Path.hs b/src/Ganeti/Path.hs
index 9383c1886..1c5496675 100644
--- a/src/Ganeti/Path.hs
+++ b/src/Ganeti/Path.hs
@@ -36,6 +36,8 @@ module Ganeti.Path
   , queueDir
   , jobQueueSerialFile
   , jobQueueArchiveSubDir
+  , instanceReasonDir
+  , getInstReasonFilename
   ) where
 
 import System.FilePath
@@ -111,3 +113,13 @@ jobQueueSerialFile = dataDirP "serial"
 -- | Job queue archive directory.
 jobQueueArchiveSubDir :: FilePath
 jobQueueArchiveSubDir = "archive"
+
+-- | Directory containing the reason trails for the last change of status of
+-- instances.
+instanceReasonDir :: IO FilePath
+instanceReasonDir = runDir `pjoin` "instance-reason"
+
+-- | The path of the file containing the reason trail for an instance, given the
+-- instance name.
+getInstReasonFilename :: String -> IO FilePath
+getInstReasonFilename instName = instanceReasonDir `pjoin` instName
-- 
GitLab