1. 23 Oct, 2012 3 commits
  2. 22 Oct, 2012 7 commits
  3. 19 Oct, 2012 11 commits
  4. 18 Oct, 2012 11 commits
  5. 17 Oct, 2012 8 commits
    • Iustin Pop's avatar
      Generalise the Result type · 93be1ced
      Iustin Pop authored
      
      
      Currently, our error monad—Result—has a plain string error type. This
      is not good, as we don't have structured errors, we can't pass back
      proper error information to Python code, etc.
      
      To solve this, we generalise this type as 'GenericResult a', and make
      Result an alias to 'GenericResult String' for compatibility with the
      old code. New error hierarchies will be introduced as different
      types. Furthermore, we generalise our helper functions too, so that
      they can work on any 'GeneralInstance a' type, not only Result.
      
      There are two small drawbacks to this generalisation. First, a Monad
      instance requires (at least for the way we use it) a 'fail :: String
      -> m a' instance, so we need to be able to build an 'a' value from a
      string; therefore, we can implement the Monad instance only for a
      newly-introduced typeclass, 'FromString', which requires the needed
      conversion function. Second, due to the fact that 'String' is a type
      alias (for [Char]) instead of an actual type, we need to enable the
      FlexibleInstances language pragma; as far as I know, this has no
      significant drawbacks.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      93be1ced
    • Dato Simó's avatar
      Merge branch 'devel-2.6' into master · 659d769d
      Dato Simó authored
      * devel-2.6:
        htools-excl.test: add test case for exclusion tags in hbal
        Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
        Group.hs: add 'allTags'; adjust loaders and test data for it
        Add hbal-excl-tags.data to Makefile.am, missed in 0397694e
      
      
      
      Conflicts:
      	Makefile.am: hbal-excl-tags.data moved under htest/
      	htools/Ganeti/HTools/Luxi.hs: types from Qlang are now used
      	htools/Ganeti/HTools/QC.hs: defGroup definition now in TestHTools.hs
      	lib/cmdlib.py: IAllocator class now in iallocator.py
      	test/htools-excl.test: moved under htest/
      Signed-off-by: default avatarDato Simó <dato@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      659d769d
    • Michael Hanselmann's avatar
      cli: Fix small typo · 90efd920
      Michael Hanselmann authored
      
      
      s/it/if/
      Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarDato Simó <dato@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
      90efd920
    • Dato Simó's avatar
    • Dato Simó's avatar
      Group.hs: add 'allTags'; adjust loaders and test data for it · 6b6e335b
      Dato Simó authored
      
      
      This commit adds a Group.allTags field to store the tags of node groups,
      and teaches each loader backend in HTools to populate it (additionally, the
      IAllocator class in lib/cmdlib.py now includes tags for groups too). Test
      data is updated to include an empty set of tags for node groups in all
      affected test cases.
      Signed-off-by: default avatarDato Simó <dato@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      6b6e335b
    • Dato Simó's avatar
      Instance.hs: rename 'tags' to 'exclTags', provide 'allTags' · 2f907bad
      Dato Simó authored
      
      
      The mergeData function in Loader.hs included a step to filter an instance's
      tags to include only the exclusion tags (as specified via the commandline,
      or cluster-level tags). Later on, code in Node.hs assumed Instance.tags to
      contain only tags to be used for exclusion.
      
      Because in the future we will need to access the full list of an instance's
      tags (and not only exclusion tags), this commits deprecates the 'tags'
      field, and introduces Instance.exclTags and Instance.allTags.
      
      Instance.allTags is now populated from the different backends (Text, Luxi,
      Rapi, etc.), and Instance.exclTags is only populated from Loader.mergeData,
      as was done previously. This means that loading tags from e.g. Text or Simu
      and assuming that they'll be used as exclusion tags without going through
      Loader.hs will no longer work; but this was already the case with other
      fields, and 'mergeData' or 'loadExternalData' continue to be the only entry
      points to get a consistent view of the cluster. (Additionally, there were
      no tests that made this assumption that I could find.)
      Signed-off-by: default avatarDato Simó <dato@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      2f907bad
    • Dato Simó's avatar
      htools-excl.test: add test case for exclusion tags in hbal · 0397694e
      Dato Simó authored
      
      
      In preparation for future modifications in the exclusion tags field, add a
      test that verifies that exclusion tags are being honored: in a test cluster
      with two instances of the same exclusion group in each node, hbal should
      shuffle instances around to improve the score.
      Signed-off-by: default avatarDato Simó <dato@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      0397694e
    • Iustin Pop's avatar
      Fix small typo in NEWS file · 18ccdced
      Iustin Pop authored
      Sorry, I didn't see this before pushing 5a7cb9d3
      
      …
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
      18ccdced