commit 314d7a116027a1aaa925abe0290174a368ac2179
Merge: 99c2b44 20c24a8
Author: Brian Foley <[email protected]>
Date:   Tue May 17 13:45:23 2016 +0100

    Merge branch 'stable-2.17'
    
    * stable-2.17
      <nothing>
    
    * stable-2.16
      Fix LogicalVolume Attach failure on missing path
      Set USE_VERSION_FULL=no if --enable-versionfull=no
      Generate concatenated error strings in parser
      Make the TH fieldsDictsKeys more efficient
      Don't verify disks when all disk templates are ext
      Improve test coverage for block device creation
      Docstring for LUClusterVerifyGroup
      Fix broken parameters in storage create methods
      Implement localized cache for lvs commands
    
    * stable-2.15
      mcpu: Raise caught OpPrereqErrors with too few args
      Make EnsureDirs print chmod mode on errors
      Fix CLI option typo in NEWS file
    
    Manually fix up python tests by adding the new HooksAbortCallBack to
    FakeLU, and update FakeConfig to return valid node UUIDs as tested by
    _ExecLU instead of dummy node names.
    
    Signed-off-by: Brian Foley <[email protected]>

diff --cc test/py/mocks.py
index 649b032,406caca..66b9cf1
--- a/test/py/mocks.py
+++ b/test/py/mocks.py
@@@ -52,7 -58,7 +58,11 @@@ class FakeConfig(object)
      return True
  
    def GetNodeList(self):
--    return ["a", "b", "c"]
++    return [
++      "01234567-89ab-cdef-fedc-aaaaaaaaaaaa",
++      "01234567-89ab-cdef-fedc-bbbbbbbbbbbb",
++      "01234567-89ab-cdef-fedc-cccccccccccc"
++    ]
  
    def GetRsaHostKey(self):
      return FAKE_CLUSTER_KEY
@@@ -64,7 -70,7 +74,7 @@@
      return "test.cluster"
  
    def GetMasterNode(self):
--    return "a"
++    return "01234567-89ab-cdef-fedc-aaaaaaaaaaaa"
  
    def GetMasterNodeName(self):
      return netutils.Hostname.GetSysName()
@@@ -139,3 -153,50 +157,53 @@@ class FakeGetentResolver(object)
  
    def LookupGid(self, gid):
      return "group%s" % gid
+ 
+ class FakeLU(object):
+   HPATH = "fake-lu"
+   HTYPE = None
+ 
+   def __init__(self, processor, op, cfg, rpc_runner, prereq_err):
+     self.proc = processor
+     self.cfg = cfg
+     self.op  = op
+     self.rpc = rpc_runner
+     self.prereq_err = prereq_err
+ 
+     self.needed_locks = {}
+     self.opportunistic_locks = dict.fromkeys(locking.LEVELS, False)
+     self.dont_collate_locks = dict.fromkeys(locking.LEVELS, False)
+     self.add_locks = {}
+ 
+     self.LogWarning = processor.LogWarning
+ 
+   def CheckArguments(self):
+     pass
+ 
+   def ExpandNames(self):
+     pass
+ 
+   def DeclareLocks(self, level):
+     pass
+ 
+   def CheckPrereq(self):
+     if self.prereq_err:
+       raise self.prereq_err
+     pass
+ 
+   def Exec(self, feedback_fn):
+     pass
+ 
+   def BuildHooksNodes(self):
+     return ([], [])
+ 
+   def BuildHooksEnv(self):
+     return {}
+ 
+   def PreparePostHookNodes(self, post_hook_node_uuids):
+     return []
+ 
+   def HooksCallBack(self, phase, hook_results, feedback_fn, lu_result):
+     return lu_result
++
++  def HooksAbortCallBack(self, phase, feedback_fn, exception):
++    pass

Reply via email to