1. 11 Apr, 2013 2 commits
  2. 21 Mar, 2013 1 commit
  3. 20 Mar, 2013 1 commit
  4. 12 Mar, 2013 6 commits
  5. 04 Mar, 2013 6 commits
    • Iustin Pop's avatar
      Fix node partial name matching in Haskell code · 91c1a265
      Iustin Pop authored
      
      
      This implements QffHostname and fixes the node listing (as well as
      export listing when filtering on node name).
      
      This bug was hidden by the fact that node listing with "gnt-node list
      aa" works if you don't have live queries (as it was originally), as
      the choosing of wanted nodes out of the config based on short names
      works. What didn't work was later post-filtering based on such short
      names (kind of duplicate, but that's how the code path is).
      
      By implementing QffHostname, we can have custom equality checks, like
      in the Python code. What I don't like is how convoluted the testing on
      various left/right combinations is, but I didn't find an easier way.
      
      The included unittest tests the partial filtering behaviour, and fails
      if the node name flag is not set to QffHostname.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      91c1a265
    • Iustin Pop's avatar
      Fix bug in group queries related to node/instance fields · e7124835
      Iustin Pop authored
      
      
      Since we use the primitive string type for group UUIDs, the group
      fields have a bug where we pass the group name as filter for node
      tests, whereas the nodes themselves use the group UUID. This results
      in zero node count, empty node list, and no instances being reported
      as assigned to groups.
      
      The patch fixes this and adds a test for the node count. It does some
      test generation improvement, and also cleans up whitespace issues in
      Test/G/Q/Query.hs (the functions case_queryNode_allfields,
      prop_queryGroup_noUnknown and case_queryGroup_allfields are unchanged
      but simply have indentation fixed).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      e7124835
    • Iustin Pop's avatar
      Abstract the individual query functions · d5b2753a
      Iustin Pop authored
      
      
      After implementing a few of the query executor functions, it turns out
      that we have the same general pattern:
      
      - compile the filter
      - extract the selected fields
      - determine whether we need to run collectors
      - do a first pass filtering
      - run the collector if needed
      - compute the final fields
      
      For pure config queries, the collector/final computation is not
      needed, but otherwise the code flow is the same.
      
      We can therefore abstract all the queries that originate in the config
      (i.e. except the job query) and have a single code path for all of
      them, just with different parameters.
      
      To do this, we add some stub collectors for group/network queries,
      which don't have live data.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      d5b2753a
    • Iustin Pop's avatar
      Allow confd to serve network list-fields queries · dce08ad3
      Iustin Pop authored
      
      
      The fields are not yet complete, but at least we can enable the
      list-field query to see what is there already.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      dce08ad3
    • Iustin Pop's avatar
      Rename/make uniform the other query entities · 36162faf
      Iustin Pop authored
      
      
      Following the new naming style introduced in Exports.hs, this patch
      renames the other resources to export non-qualified names (fieldMap as
      opposed to nodeFieldMap), and to use qualified module imports.
      
      Also fixes a haddock issue in a docstring.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      36162faf
    • Dimitris Aragiorgis's avatar
      Fix confd issue regarding --no-lvm-storage · 64b0309a
      Dimitris Aragiorgis authored
      
      
      If cluster is initialized with --no-lvm-storage then volume_group_name
      does not exist in config.data. Thus we must define it as optional in
      confd.
      Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
      [iustin@google.com: fixed Haskell RPC definition]
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      64b0309a
  6. 25 Feb, 2013 1 commit
    • Iustin Pop's avatar
      Implement Export queries in Haskell · c4bf507b
      Iustin Pop authored
      
      
      This is a simple query as it has only two fields, however it's the
      first query that doesn't have a clear 'base' object and 1:1
      correspondence between such objects and the results (groups, nodes and
      networks do so).
      
      We keep nodes as the 'base' object, since that's what we want to
      filter on for RPC selection, and we have a very simple type as the
      runtime type, since we only have one other field. The
      'collectLiveData' function is the one that does the expansion from
      [node] to [(node, path)], with the help of 'rpcExtractor'.
      
      Also, this patch introduces a slightly different naming structure for
      the exported names out of the module, to reduce naming conflicts.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      c4bf507b
  7. 22 Feb, 2013 1 commit
  8. 20 Feb, 2013 1 commit
    • Iustin Pop's avatar
      Simplify RPC error cases · 9c0a27d0
      Iustin Pop authored
      
      
      This patch removes the node from the RPC error constructurs
      CurlLayerError and OfflineNodeError. The rationale is that we anyway
      return tuples (node, result), and removing this duplication allows
      simplified signatures/calls in the execution of RPC calls.
      
      Note: this was sent before as well, resending on top of current codebase.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
      9c0a27d0
  9. 18 Feb, 2013 1 commit
  10. 07 Feb, 2013 1 commit
  11. 05 Feb, 2013 1 commit
  12. 29 Jan, 2013 2 commits
  13. 25 Jan, 2013 1 commit
  14. 24 Jan, 2013 2 commits
    • Helga Velroyen's avatar
      First part of Network Queries in Haskell · 05092772
      Helga Velroyen authored
      
      
      This is the beginning of the implementation of network
      queries. This includes establishing all infrastructure
      to run the network queries and implement querying of
      some simpler fields and the node group listing.
      Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      05092772
    • Helga Velroyen's avatar
      Convert Maybe results to RSUnavail · a64cc96b
      Helga Velroyen authored
      
      
      When displaying query results of type Maybe, one could use the
      function rsMaybe. Unfortunately, this function maps 'Nothing'
      values to RSNoData which gets displayed as '?' in the list of
      query results. These semantics do not fit if the result is of
      a Maybe type, because it is an optional field, because in this
      case 'Nothing' is not an error (like for example the consequence
      of an RPC error), but a legitimate result and as such should
      be displayed as '-' in the result list. For this purpose,
      this patch introduces another version of rsMaybe, which is
      called rsMaybeUnavail to be used for optional fields.
      For consistency, rsMaybe gets renamed to rsMaybeNoData.
      Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      a64cc96b
  15. 24 Dec, 2012 1 commit