Skip to content
Snippets Groups Projects
  1. Feb 22, 2011
  2. Feb 17, 2011
    • Iustin Pop's avatar
      NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes · effab4ca
      Iustin Pop authored
      
      Since we don't have the data per design, UNAVAIL is appropriate here,
      while NODATA is not.
      
      The patch also adds a comment: if we extend the live fields list to
      contain other data in the future, we need to reevaluate this solution.
      
      This should fix issue 143. The listing now shows (node2==ofline,
      node3==not vm_capable):
      
        Node     DTotal     DFree    MTotal     MNode     MFree Pinst Sinst
        node1    698.6G    630.5G     32.0G      1.0G     30.0G     8     7
        node2 (offline) (offline) (offline) (offline) (offline)     9     4
        node3 (unavail) (unavail) (unavail) (unavail) (unavail)     0     0
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      effab4ca
  3. Jan 28, 2011
  4. Jan 21, 2011
  5. Jan 20, 2011
  6. Jan 18, 2011
    • Iustin Pop's avatar
      query: use the actual types for BE/HV parameters · af58707c
      Iustin Pop authored
      
      This patch exposes the VTYPE kind of BE/HV parameters, instead of
      returning QFT_OTHER. The current situation makes a query like:
      
          gnt-instance list -o name,be/memory,oper_ram
      
      very strange looking.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      af58707c
    • Iustin Pop's avatar
      query: return UNAVAIL for "wrong" HV parameters · ff4cd4d2
      Iustin Pop authored
      
      If a HV parameter is required that does not apply for an instance,
      currently the code returns None. This is bad, as it means we cannot
      switch to the actual HV parameter types and validate correctly this
      field.
      
      This patch changes it so that in this case we return QRFS_UNAVAIL;
      ideally we would use a NOT_APPROPRIATE or similar field, but UNAVAIL is
      good enough (the call cannot fail in another way).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      ff4cd4d2
    • Iustin Pop's avatar
      query: change (debug-mode) field validation errors · d1c3c3b3
      Iustin Pop authored
      
      Currently, the single assert just checks that the entire row is
      consistent (true/false), and dumps the row and field definitions as an
      accompanying message. This makes it very hard to understand what failed.
      
      This patch changes this validation to show descriptive messages, which
      makes it much faster in diagnosing invalid result.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      d1c3c3b3
    • Iustin Pop's avatar
      Rename a few instance field titles · 0ca7e384
      Iustin Pop authored
      
      The conversion to querylib introduced unique field titles, which however
      did an inconsistent rename of the instance vcpus/memory fields.
      
      This patch makes both BE_MEMORY and _VCPUS be named with prefix “Config”
      (which before was “Configured_”), and drops the “Runtime” (note no
      underscore) prefix on the oper_ ones.
      
      Rationale: for numeric fields, the width of the title defines the width
      of the columns, as the numbers are usually small. Hence these columns
      (more likely used than the BE ones) would be very wide, leading to a
      not-so-nice display. I happened upon this when my terminals didn't
      manage to fit a gnt-instance list anymore.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      0ca7e384
    • Iustin Pop's avatar
      query: Change internal result computation · e2d188cc
      Iustin Pop authored
      
      While looking at the query library, I realized that while we have five
      field statuses, making this a 5-dimensional space, four of them are
      shrunk to a single possible value (None). Hence it should be possible to
      convert this into a single value space plus extra 4 special constants.
      
      This patch implements this, making (IMHO) the return value of normal
      functions much simpler: you simply return the desired value, instead of
      (QRFS_NORMAL, value); for the special results, you simply return
      _FS_UNAVAIL, instead of (QRFS_UNAVAIL, None). This I believe does
      simplify the code.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      e2d188cc
    • Iustin Pop's avatar
      Import QRFS_* and QFT_* in query.py · 82599b3e
      Iustin Pop authored
      
      Currently, the QRFT/QFT constants are used with the module (e.g.
      constants.QRFS_NORMAL) in the query library. Given that there are 176
      uses of these constants in a module that has roughly ~1200 lines in
      total (including whitespace), it makes sense to import these directly to
      improve readability.
      
      This patch does this and (IMHO) it does indeed make the code more to the
      point; the entire query library is about queries, so using these
      constants directly doesn't cause any misunderstandings.
      
      Note: the epydoc links are not changed, since we want the generated docs
      to point to the right place.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      82599b3e
  7. Jan 14, 2011
  8. Jan 13, 2011
  9. Jan 06, 2011
  10. Jan 05, 2011
  11. Dec 21, 2010
  12. Dec 13, 2010
  13. Dec 10, 2010
  14. Dec 08, 2010
  15. Nov 29, 2010
Loading