1. 13 May, 2014 2 commits
  2. 12 May, 2014 2 commits
  3. 05 May, 2014 3 commits
  4. 27 Mar, 2014 2 commits
  5. 07 Mar, 2014 1 commit
  6. 26 Feb, 2014 1 commit
  7. 14 Feb, 2014 1 commit
  8. 07 Feb, 2014 1 commit
  9. 04 Feb, 2014 1 commit
  10. 20 Jan, 2014 1 commit
  11. 08 Nov, 2013 1 commit
  12. 05 Nov, 2013 1 commit
  13. 17 Oct, 2013 1 commit
  14. 16 Oct, 2013 2 commits
  15. 18 Jul, 2013 1 commit
  16. 20 Jun, 2013 1 commit
    • Thomas Thrainer's avatar
      Index instances by their UUID · da4a52a3
      Thomas Thrainer authored
      
      
      No longer index instances by their name but by their UUID in the cluster
      config. This change changes large parts of the code, as the following
      adjustments were necessary:
       * Change the index key to UUID in the configuration and the
         ConfigWriter, including all methods.
       * External interfaces (command line interface, IAllocator interface,
         hook scripts, etc.) are kept stable.
       * Instance UUID's are resolved in ExpandNames and then stored in the
         OpCode. This allows to check for instance renames if the OpCode is
         reloaded after a cluster restart. This check is currently only done
         for single instance parameters.
       * Instance locking unfortunately can't use instances UUID as
         identifiers. The reasons is that new instances (which have no UUID
         yet) have to be locked as well, so the instance name is used.
       * Variable names are renamed to follow the following pattern:
         - Suffix is 'inst' or 'insts': Variable holds Instance objects
         - Suffix is 'name' or 'names': Variable holds Instance names
         - Suffix is 'uuid' or 'uuids': Variable holds Instance UUID's
       * Tests are adapted.
      Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
      Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
      da4a52a3
  17. 13 Jun, 2013 1 commit
    • Thomas Thrainer's avatar
      Index nodes by their UUID · 1c3231aa
      Thomas Thrainer authored
      
      
      No longer index nodes by their name but by their UUID in the cluster
      config. This change changes large parts of the code, as the following
      adjustments were necessary:
       * Change the index key to UUID in the configuration and the
         ConfigWriter, including all methods.
       * Change all cross-references to nodes to use UUID's.
       * External interfaces (command line interface, IAllocator interface,
         hook scripts, etc.) are kept stable.
       * RPC-calls can resolve UUID's as target node arguments, if the RPC
         runner is based on a ConfigWriter instance. The result dictionary is
         presented in the form the nodes are addressed: by UUID if UUID's were
         given, or by name if names were given.
       * Node UUID's are resolved in ExpandNames and then stored in the
         OpCode. This allows to check for node renames if the OpCode is
         reloaded after a cluster restart. This check is currently only done
         for single node parameters.
       * Variable names are renamed to follow the following pattern:
         - Suffix is 'node' or 'nodes': Variable holds Node objects
         - Suffix is 'name' or 'names': Variable holds node names
         - Suffix is 'uuid' or 'uuids': Variable holds node UUID's
       * Tests are adapted.
      Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
      Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
      1c3231aa
  18. 29 Jan, 2013 1 commit
  19. 24 Jan, 2013 1 commit
  20. 24 Dec, 2012 1 commit
  21. 21 Nov, 2012 2 commits
    • Iustin Pop's avatar
      Move the 'Hypervisor' type from Objects to Types · 22381768
      Iustin Pop authored
      
      
      This is a very basic type and 'Objects' is a heavy-weight module. By
      moving it to 'types' we simplify (in the future) the import chains.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
      22381768
    • Iustin Pop's avatar
      Generalise the JSON "Container" type · edc1acde
      Iustin Pop authored
      
      
      Currently, we have some types that we kept as dictionaries in the
      objects representation (due to inconsistent behaviour, or other
      technical reasons). This should be improved in the future, but in the
      meantime we can improve the Container type by allowing its keys to be
      non-strings; this is needed, for example, for better safe in
      DiskParams type, where we don't want arbitrary strings as keys, but
      only the actually defined types.
      
      To implement this change, we generalise the type (Container →
      GenericContainer), and in the process we introduce a type class for
      "things that can be represented as strings". This is very similar to a
      combination of Read and Show, but with custom string
      representation. The new type class is needed because in JSON
      representation, object keys must be strings, so we need to be able to
      serialised/deserialise the generic keys to/from plain strings.
      
      We also add the instance for DiskTemplate at the same time.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAdeodato Simo <dato@google.com>
      edc1acde
  22. 25 Oct, 2012 1 commit
    • Iustin Pop's avatar
      Convert query path from string errors to GanetiException · 5183e8be
      Iustin Pop authored
      
      
      This patch converts all the call paths from 'Result' (which contains
      just string errors) to 'ErrorResult', which holds
      GanetiException-encoded errors. We can now return proper
      OpPrereq/OpExec errors to the clients of the luxi/query socket.
      
      The patch touches many files as we had to convert the entire call
      chains in a single round. But it should be pretty straightforward
      otherwise:
      
      - change 'Result' into 'ErrorResult'
      - add error annotations: change "Bad msg" into "Bad (XXXEror msg)"
      - add a helper function for confd, where we don't send to client
        formatted exceptions, to convert back from ErrorResult into Result
      - change tests similarly, where needed
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      5183e8be
  23. 11 Oct, 2012 1 commit
  24. 10 Oct, 2012 1 commit
  25. 26 Sep, 2012 1 commit
  26. 05 Sep, 2012 1 commit
    • Iustin Pop's avatar
      Further hlint fixes · 5b11f8db
      Iustin Pop authored
      Commit 2cdaf225, “Re-enable standard hlint warnings”, got it almost
      right. The only problem is that (confusingly) the default set of hints
      is not in HLint.Default, but in HLint.HLint (it includes Default and
      some built-ins).
      
      After changing the lint file to correctly include the defaults, we had
      another 128 suggestions:
      
        - Error: Eta reduce (2)
        - Error: Redundant bracket (4)
        - Error: Redundant do (17)
        - Error: Redundant lambda (7)
        - Error: Redundant return (1)
        - Warning: Avoid lambda (2)
        - Warning: Redundant $ (42)
        - Warning: Redundant bracket (35)
        - Warning: Use : (1)
        - Warning: Use String (4)
        - Warning: Use camelCase (10)
        - Warning: Use section (3)
      
      which are fixed by the current patch. Note that the 10 "Use camelCase"
      were all due to hlint not “knowing” the idiom of ‘case_’ (it does for
      ‘prop_’), for which I filled
      http://code.google.com/p/ndmitchell/issues/detail?id=558
      
      .
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      5b11f8db
  27. 04 Sep, 2012 1 commit
  28. 03 Sep, 2012 2 commits
    • Iustin Pop's avatar
      Add more node-related data types and functions · da45c352
      Iustin Pop authored
      
      
      This is a simple type declaration for NodeRole, a NdParamObject type
      class, and a few related helper functions for nodes and node groups.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      da45c352
    • Iustin Pop's avatar
      Expand Objects.hs definitions · b09cce64
      Iustin Pop authored
      
      
      This patch adds the missing parameters in the cluster/group objects,
      for now as simple maps (dictionaries), without type safety. The
      rationale for adding them as such is:
      
      - we need something to enable query functionality
      - since we don't modify the values, we don't risk introducing bugs
      - we can improve the types later, once we find a good way to declare
        them
      
      Also, I renamed a few of the parameters, dropping capitalisation of
      acronyms (NIC → Nic, etc.).
      
      At this point, I believe that the definitions are complete, with any
      missing items being just oversight, and not intentionally removed (due
      to lack of types, etc.).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      b09cce64
  29. 28 Aug, 2012 3 commits
    • Iustin Pop's avatar
      Config.hs: Add a function to lookup group · 4cd428db
      Iustin Pop authored
      
      
      Like in the python code, this is a bit more complex since groups are
      indexed by UUID, so we must fallback to lookup via the name (slow; but
      the number of groups should be small).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      4cd428db
    • Iustin Pop's avatar
      Re-enable standard hlint warnings · 2cdaf225
      Iustin Pop authored
      Commit 5a1e31b4
      
       (Add infrastructure for, and two extra hlint rules)
      was intended to add two *extra* hlint rules, but I didn't realise at
      that time that "--hint" when first used overrides the built-in
      lints. As such, since then we were basically running with just those
      two rules, which resulted in many uncaught warnings/errors.
      
      This patch fixes that (by importing the standard lint rules in our
      custom hints file), and then goes to fix all the warnings that a
      current hlint gives me. Compared to our current style, we have just a
      few additions:
      
      - zipWithM instead of map foo . zip …
      - 'exitSuccess' instead of 'exitWith ExitSuccess'
      - more uses of '.'
      
      Additionally, we have to silence a case where hlint doesn't realise
      why we are using '\e -> const (return False (e :: IOError)' instead of
      just '\e -> return False' or even 'const (return False').
      
      One warning that is generated by hlint ("Use void") can't be fixed
      until we deprecate GHC 6.x, as only GHC 7 has the 'void' function in
      Control.Monad.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      2cdaf225
    • Iustin Pop's avatar
      Improve the TH 'Container' type · 84835174
      Iustin Pop authored
      
      
      This is the first part of the changes related to the 'Container' type.
      
      We currently handle this type as follows: it's a simple type alias
      over the Data.Map type, which means:
      
      - it's easy to use the Data.Map functions to change the type
      - however, since Data.Map already has a JSON instance, we have to very
        carefully always use custom show/read routines to handle this type
      
      The second point leads to potential bugs which are not caught by the
      type system, so let's improve the situation by making it a proper
      newtype, which can have its own JSON instance (with our desired
      behaviour). Once we do this change, accessing the type requires an
      extra function call, but it's as safe as before. On the positive side,
      we can use the implicit read/show JSON, which means we can remove (in
      the next patch) the "container" special casing.
      
      The patch also moves the type to outside of THH, since not all users
      of this will want to import that (as opposed to JSON.hs, which is
      smaller).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      84835174
  30. 19 Jul, 2012 1 commit