Skip to content
Snippets Groups Projects
  1. Jun 23, 2010
  2. Mar 09, 2010
  3. Feb 11, 2010
  4. Jan 04, 2010
  5. Nov 25, 2009
  6. Oct 05, 2009
  7. Sep 18, 2009
  8. Aug 24, 2009
  9. Jun 15, 2009
    • Iustin Pop's avatar
      Big rewrite of the OS-related functions · 255dcebd
      Iustin Pop authored
      
      Currently the OSes have a special, customized error handling: the OS
      object can represent either a valid OS, or an invalid OS. The associated
      function, instead of raising other exception or failing, create custom
      OS objects representing failed OSes.
      
      While this was good when no other RPC had failure handling, it's
      extremely different from how other function in backend.py expect
      failures to be signalled.
      
      This patch reworks this completely:
        - the OS object always represents valid OSes (the next patch will
          remove the valid/invalid field and associated constants)
        - the call_os_diagnose returns instead of a list of OS objects, a list
          of (name, path, status, diagnose_msg); the status is then used in
          cmdlib to determine validity and the status and diagnose_msg values
          are used in gnt-os for display
        - call_os_get returns either a valid OS or a RPC remote failure (with
          the error message)
        - the other functions in backend.py now just call backend.OSFromDisk()
          which will return either a valid OS object or raise an exception
        - the bulk of the OSFromDisk was moved to _TryOSFromDisk which returns
          status, value for the functions which don't want an exception raised
      
      The gnt-os list and diagnose commands still work after this patch.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      255dcebd
  10. Nov 23, 2008
    • Iustin Pop's avatar
      Enable auto-unit formatting in script output · 9fbfbb7b
      Iustin Pop authored
      This patch enables by default the old 'human-readable' option, but in a
      slightly different model.
      
      The option is now called "units" and takes either:
       - 'h' for automatic formatting
       - 'm', 'g' or 't' for mebi/gibi/tebibytes
      
      If 'h' is used, we add a unit suffix, otherwise nothing is added so that
      parsing is easy.
      
      The default value of this unit is:
        - 'h' if a separator is not passed
        - 'm' if a separator is passed
      
      Reviewed-by: ultrotter
      9fbfbb7b
  11. Oct 27, 2008
  12. Oct 20, 2008
    • Iustin Pop's avatar
      Fix some pylint-detected issues on the scripts · 2f79bd34
      Iustin Pop authored
      Some names were wrong, and similar stuff detected by pylint.
      gnt-debug.GenericOpCode is still broken.
      
      Reviewed-by: imsnah
      2f79bd34
    • Iustin Pop's avatar
      Convert the gnt scripts to ToStdout/err · 3a24c527
      Iustin Pop authored
      Currently the gnt-* scripts are using a mix of print, logger.ToStd* and
      sys.stderr.write. We convert them all to using cli.ToStdout/err. This
      way, we can easily change the implementation for all at once.
      
      Reviewed-by: imsnah
      3a24c527
  13. May 13, 2008
    • Iustin Pop's avatar
      Revert "CLI: remove command opts/args in "gnt-X"" · 9a033156
      Iustin Pop authored
      This reverts commit 976.
      
      Reviewed-by: ultrotter
      9a033156
    • Iustin Pop's avatar
      CLI: remove command opts/args in "gnt-X" · 57d0151e
      Iustin Pop authored
      [Forward-port of the 1.2 branch patch]
      
      This patch removes all the parameters and options from the output
      "gnt-X" (i.e. the subcommand list for command). This is done in order to
      uniformize the output, currently only some parameters are shown and they
      are not always consistent (e.g. required versus important parameters).
      
      Reviewed-by: ultrotter
      57d0151e
  14. Apr 10, 2008
    • Iustin Pop's avatar
      Rework the results of OpDiagnoseOS opcode · 1f9430d6
      Iustin Pop authored
      Currently, the opcode DiagnoseOS is the only opcode that return a
      structure of objects.OS (which is a custom class, and not a simple
      python object) and furthermore all the processing of OS validity across
      nodes is left to the clients of this opcode.
      
      It would be more logical to have this opcode be similar to list
      instances/nodes, in the sense that:
        - it should return a table of results
        - the fields in the table should be selectable
      
      This patch does the above. The possible fields are:
        - name (os name)
        - valid (bool representing validity across all nodes)
        - node_status, which is a complicated structure required for ‘gnt-os
          diagnose’
      
      With this patch, gnt-os list becomes a very simple iteration over the
      list of results, filtering out non-valid ones. gnt-os diagnose is still
      complicated, but no more than before.
      
      The burnin tool has also been modified to work with the modified
      results, and is simpler because of this (it only needs to know if an OS
      is valid or not, not the per-node details).
      
      Reviewed-by: imsnah
      1f9430d6
  15. Nov 05, 2007
    • Guido Trotter's avatar
      Make DiagnoseOS use the modified OS objects · 8fa42c7c
      Guido Trotter authored
      Modify backend.py so that DiagnoseOS only returns OS objects rather than
      InvalidOS errors, and make sure gnt-os understands the new objects. Also delete
      the deprecated helper functions from gnt-os.
      
      Reviewed-By: iustinp
      
      8fa42c7c
  16. Nov 01, 2007
    • Guido Trotter's avatar
      Remove two trailing whitespaces · d06565e0
      Guido Trotter authored
      Ok, I've been battling with those for a while but it seems
      in the end I forgot to get rid of them! :( Doing it explicitely now.
      
      Reviewed-By: iustinp
      d06565e0
    • Guido Trotter's avatar
      Move blank lines inside function messages · 2527691a
      Guido Trotter authored
      This patch changes whitespace only. It fixes all the functions in script/gnt-os
      by putting a white line at the end of all the function descriptions and
      removing it from just before the code.
      
      Reviewed-By: iustinp
      2527691a
    • Guido Trotter's avatar
      Add empty line after each diagnose OS-Node set · dd96409a
      Guido Trotter authored
      Reviewed-By: imsnah
      dd96409a
    • Guido Trotter's avatar
      Modify the displayed format for gnt-os diagnose · 107b0ccb
      Guido Trotter authored
      Get rid of the tabulated form and create a simplier indented structure.
      Now a valid OS looks something like:
      
      OS: foo [global status: partial valid]
        Node: gsdtest4.euw.corp.google.com, status: valid (path: /usr/local/lib/ganeti/os/foo)
        Node: gsdtest5.euw.corp.google.com, status: valid (path: /usr/local/lib/ganeti/os/foo)
          [hidden] path: /usr/local/lib/ganeti/os2/foo, status: 'ganeti_api_version' file not found (ENOENT)
        Node: gsdtest3.euw.corp.google.com, status: 'ganeti_api_version' file not found (ENOENT) (path: /usr/local/lib/ganeti/os/foo)
      
      Reviewed-By: imsnah
      107b0ccb
    • Guido Trotter's avatar
      Change the way to compute the first os status message · 48f85f75
      Guido Trotter authored
      Use both _DiagnoseOSStatus and  _DiagnoseOSPath to calculate the message
      associated with the first entry found on a node for an OS. Also call the rename
      the relevant variables to _msg rather than just _status to reflect that they
      contain a bit more than just the bare status message.
      
      Reviewed-By: imsnah
      
      48f85f75
    • Guido Trotter's avatar
      Separate OS status and path · 5efc50fc
      Guido Trotter authored
      Make _DiagnoseOSStatus only return a status message for the OS diagnose object
      and create a new _DiagnoseOSPath function to get the path out. This will let us
      be more flexible in the messages we display to the user.
      
      Reviewed-By: imsnah
      5efc50fc
  17. Oct 29, 2007
  18. Oct 15, 2007
  19. Oct 12, 2007
    • Guido Trotter's avatar
      Reorder gnt-os simplify _GetAllOS and call it _DiagnoseByOS · fbdb07b9
      Guido Trotter authored
      Put some order in gnt-os putting helper functions above and command functions
      below. Also add a new _DiagnoseOSName() function and use it to make _GetAllOS
      simplier to understand. Change its name to _DiagnoseByOS which makes more clear
      what it does.
      
      
      
      Reviewed-by: iustinp
      
      fbdb07b9
    • Guido Trotter's avatar
      Fix ListOS which was broken · 216fe2f3
      Guido Trotter authored
      To do this we abstract the creation of the all_os dictionary, which was
      produced in DiagnoseOS and use it both for listing and diagnosing.
      
      
      Reviewed-by: iustinp
      
      216fe2f3
  20. Oct 09, 2007
Loading