Skip to content
Snippets Groups Projects
  1. Oct 24, 2008
    • Iustin Pop's avatar
      Modify utils.RunCmd to write output to file · 36117c2b
      Iustin Pop authored
      Currently we launch processes via the shell in a few places only to
      redirect standard output and error to a log file ("&> $file"). It is
      better to do such redirection from within RunCmd itself.
      
      This patch splits RunCmd in two parts, the setup and the execution part,
      the latter being implemented in two different functions depending on
      whether we write to a file or not.
      
      We also update the unittests with this new case.
      
      Reviewed-by: imsnah
      36117c2b
  2. Oct 21, 2008
    • Iustin Pop's avatar
      Move some LU logging to use proc.Log* · 86d9d3bb
      Iustin Pop authored
      We change some messages which are obviously intended for the user to use
      the proc.Log* functions instead of (only) the logging ones.
      
      We also fix some wrong uses of feedback_fn.
      
      Reviewed-by: imsnah
      86d9d3bb
  3. Oct 20, 2008
    • Iustin Pop's avatar
      Generalize the reading of test file data · 149a5439
      Iustin Pop authored
      Currently we have two methods in ganeti.bdev_unittest.py of computing
      the test data file name - and, of course, they don't give the same
      results.
      
      The patch moves the functions to compute the test file name and reading
      of its contents to the GanetiTestCase class in testutils, which allows
      running the tests from the command line as well.
      
      We also change assertFileContent to use utils.ReadFile.
      
      Reviewed-by: imsnah
      149a5439
    • Alexander Schreiber's avatar
      Set default hypervisor at cluster init · 02691904
      Alexander Schreiber authored
      During cluster init, set the default hypervisor to be used for instances.
      Ensure that the default hypervisor belongs to the set enabled hypervisors
      for this cluster. Also fix a small bug with setting the default enabled
      hypervisor list.
      
      Reviewed-by: imsnah
      
      02691904
    • Iustin Pop's avatar
      Convert cli.py to logging · 46fbdd04
      Iustin Pop authored
      We also add two function for printing messages, so that scripts won't
      have to import logger to get these. They are a simple extension over the
      logger ones, as they accept the call style from logging:
       ToStdout("Message: %s", msg)
      (instead of requiring formatting by the client.
      
      Reviewed-by: imsnah
      46fbdd04
    • Michael Hanselmann's avatar
      Remove old HTTP server code · fa10bdc5
      Michael Hanselmann authored
      All users of this code have been migrated to the new and shiny HttpServer
      class.
      
      It also fixes a typo in the ApacheLogfile unittests. It has not yet been
      decided whether we should keep ApacheLogfile or not, hence leaving it in.
      
      Reviewed-by: ultrotter
      fa10bdc5
  4. Oct 17, 2008
  5. Oct 16, 2008
    • Iustin Pop's avatar
      Really fix with the zombie test (hopefully) · 09352fa4
      Iustin Pop authored
      So, instead of any timeouts for synchronization, we move to actual
      events. We still have one (huge) timeout for pathological cases (just to
      cleanup), but we don't sleep at all in normal usage.
      
      The patch moves the zombie/cleaned up child creation out from setUp(),
      and to on-demand by the functions. We remove all signal handler usage,
      instead we rely on the fact that when a process is cleaned up, its FDs
      are closed, so the read end of a pipe will get an event.
      
      Reviewed-by: imsnah
      09352fa4
  6. Oct 14, 2008
    • Iustin Pop's avatar
      Implement parameter removal in SplitKeyVal · fcd62d84
      Iustin Pop authored
      This patch adds paramter removal in SplitKeyVal, by prefixing a
      value-less key with "-"; this is needed in resetting parameters back to
      cluster defaults, but care must be applied now that None can come from
      the parser.
      
      Reviewed-by: imsnah
      fcd62d84
  7. Oct 13, 2008
    • Iustin Pop's avatar
      Add two new options types for CLI usage · a8469393
      Iustin Pop authored
      For the new 2.0-style command line options, we need to parse strings of
      the type:
        ident:key=val[,...]
      and
        key=val[,...]
      
      This patch adds two new option builders for these two, which return
      (ident, {key=val,}) and {key=val,} for the above two formats. It also
      handles specially constructs of type “key” (val is set to True) and
      “no_key” (val is set to False, and the ‘no_’ prefix is stripped).
      
      Reviewed-by: imsnah
      a8469393
  8. Oct 12, 2008
    • Iustin Pop's avatar
      Abstract checking own address into a function · caad16e2
      Iustin Pop authored
      Currently, we check if we have a given ip address (i.e. it's alive on
      one of our interfaces) but manually calling TcpPing(source=localhost).
      This works, but having it spread all over the code makes it hard to
      change the implementation.
      
      The patch abstracts this into a separate utils.OwnIpAddress(addr)
      function. We add a rpc call for it, which we use instead of the
      (single-use of) call_node_tcp_ping. We leave node_tcp_ping in, as seems
      useful and eventually it should be removed in a separate patch.
      
      Reviewed-by: imsnah
      caad16e2
  9. Oct 10, 2008
    • Iustin Pop's avatar
      Convert rpc module to RpcRunner · 72737a7f
      Iustin Pop authored
      This big patch changes the call model used in internode-rpc from
      standalong function calls in the rpc module to via a RpcRunner class,
      that holds all the methods. This can be used in the future to enable
      smarter processing in the RPC layer itself (some quick examples are not
      setting the DiskID from cmdlib code, but only once in each rpc call,
      etc.).
      
      There are a few RPC calls that are made outside of the LU code, and
      these calls are left as staticmethods, so they can be used without a
      class instance (which requires a ConfigWriter instance).
      
      Reviewed-by: imsnah
      72737a7f
  10. Oct 08, 2008
  11. Oct 06, 2008
    • Iustin Pop's avatar
      Add a simple timespec parsing function · 2241e2b9
      Iustin Pop authored
      This function will be used for auto-archiving jobs via the command line.
      The function is pretty simple, we only support up to weeks since months
      and higher are not 'precise' entities, and dealing with them would
      require us to start using calendar functions.
      
      Reviewed-by: imsnah
      2241e2b9
  12. Oct 01, 2008
  13. Sep 11, 2008
    • Guido Trotter's avatar
      LockSet: forbid add() on a partially owned set · d2aff862
      Guido Trotter authored
      This patch bans add() on a half-acquired set. This behavior was
      previously possible, but created a deadlock if someone tried to acquire
      the set-lock in the meantime, and thus is now forbidden. The
      testAddRemove unit test is fixed for this new behavior, and includes a
      few more lines of testing and a new testConcurrentSetLockAdd function
      tests its behavior in the concurrent case.
      
      Reviewed-by: imsnah
      d2aff862
    • Guido Trotter's avatar
      Fix LockSet._names() to work with the set-lock · d4803c24
      Guido Trotter authored
      If the set-lock is acquired, currently, the _names function will fail on
      a double acquire of a non-recursive lock. This patch fixes the behavior,
      and some lines of code added to the testAcquireSetLock test check that
      this and other functioins behave properly.
      
      Reviewed-by: imsnah
      d4803c24
  14. Sep 05, 2008
  15. Aug 29, 2008
  16. Aug 18, 2008
    • Guido Trotter's avatar
      A few more locking unit tests · d4f6a91c
      Guido Trotter authored
      A few more tests written while bug-hunting. One of them shows a real
      issue, at last. :)
      
      Reviewed-by: imsnah
      d4f6a91c
    • Guido Trotter's avatar
      Add lock-all-through-GLM unit test · 90c942d1
      Guido Trotter authored
      I was hunting for a bug in my code and thought the culprit was in the
      locking library, so I added a test to check. Unfortunately turns out it
      wasn't. :( Committing the test anyway, while still trying to figure out
      what's wrong...
      
      Reviewed-by: imsnah
      90c942d1
  17. Aug 11, 2008
  18. Jul 31, 2008
  19. Jul 30, 2008
  20. Jul 29, 2008
    • Iustin Pop's avatar
      Add a KillProcess function · b2a1f511
      Iustin Pop authored
      We cannot depend on all environments to have a start-stop-daemon or
      similar tool. We instead implement a KillProcess function that behaves
      similar to “start-stop-daemon --retry”.
      
      Note that the attached unittest can hang in foreground if the child
      misbehaves (doesn't write to the internal pipe). Since unittest are
      either run in the foreground or are run with a timeout from an automated
      framework, I think this is an acceptable trade-off (against of using
      hardcoded timeouts in the test).
      
      Reviewed-by: imsnah
      b2a1f511
    • Iustin Pop's avatar
      Change IsPidFileAlive into ReadPidFile · d9f311d7
      Iustin Pop authored
      We already have a function to test if a PID is alive, so it makes more
      sense to use function composition that force calling (since we need to
      read PIDs from files in other places too). Now IsProcessAlive returns
      False for PIDs <= 0, since this is the error return from ReadPidFile.
      
      The patch also adds a unittest for checking that WriteFile raises the
      correct exception, and checks that an invalid or missing file causes
      ReadPidFile to return zero. The unittest tearDown method will try to
      cleanup the temp directory too (otherwise it leaves stuff after it).
      
      Reviewed-by: ultrotter
      d9f311d7
  21. Jul 28, 2008
  22. Jul 24, 2008
  23. Jul 23, 2008
    • Guido Trotter's avatar
      Invert nodes/instances locking order · 04e1bfaf
      Guido Trotter authored
      An implementation mistake from the original design caused nodes to be
      locked before instances, rather than after. This patch inverts the level
      numbering, changing also the relevant unittests and the recursive
      locking function starting point.
      
      Reviewed-by: iustinp
      04e1bfaf
  24. Jul 22, 2008
  25. Jul 11, 2008
  26. Jul 09, 2008
Loading