Skip to content
Snippets Groups Projects
  1. Nov 12, 2008
    • Michael Hanselmann's avatar
      ganeti.rpc: Use utils.ReadFile instead of reading file directly · 4c7c81d7
      Michael Hanselmann authored
      Reviewed-by: iustinp
      4c7c81d7
    • Michael Hanselmann's avatar
      utils.SetupLogging: Remove previously setup handlers · 6346a9e5
      Michael Hanselmann authored
      If a logging function is called before the logging module is setup
      using utils.SetupLogging, it calls logging.basicConfig, which adds
      a StreamHandler, on its own. If we leave it in, all log output will
      be printed twice on stderr. This patch makes sure to remove all
      handlers before adding our own.
      
      Reviewed-by: iustinp
      6346a9e5
    • Michael Hanselmann's avatar
      jqueue: Always use rpc.RpcRunner · a3811745
      Michael Hanselmann authored
      "from ganeti.rpc import RpcRunner" does not conform to the style guide.
      
      Reviewed-by: iustinp
      a3811745
    • Michael Hanselmann's avatar
      bootstrap: Always use rpc.RpcRunner · fda5f19f
      Michael Hanselmann authored
      "from ganeti.rpc import RpcRunner" does not conform to the style guide.
      
      Reviewed-by: iustinp
      fda5f19f
    • Michael Hanselmann's avatar
      ganeti.rpc: Convert to ganeti.serializer · 7c28c575
      Michael Hanselmann authored
      This is one of the last places where the simplejson module is
      used directly.
      
      Reviewed-by: iustinp
      7c28c575
    • Michael Hanselmann's avatar
      Convert RPC module to new HTTP client · ecfe9491
      Michael Hanselmann authored
      Currently, HttpClientManager is instantiated for every RPC call. This
      will be changed with another patch, as will the use of SSL. The “Run”
      method is no longer needed.
      
      Reviewed-by: iustinp
      ecfe9491
    • Iustin Pop's avatar
      Convert the locking unittests to repetition-test · 4607c978
      Iustin Pop authored
      Currently the locking tests are using timeouts to ensure an event will
      'never happen'. However, this is suboptimal.
      
      The patch converts all of these to instead: not wait, but sequence the
      operations logically and expect that they execute as such. In case of
      not so, they will timeout with a big (60s) timeout.
      
      The 'never happen' is tested by multiple repetitions of the same test -
      this is not perfect, but again 'X will never happen' is not actually
      testable.
      
      This patch reduces the runtime of the tests from ~5.4 to ~0.8 seconds
      (with 8 repetitions of each test thas has 'never happen' situations).
      
      Reviewed-by: imsnah
      4607c978
    • Iustin Pop's avatar
      Fix utils.KillProcess · e1bd0072
      Iustin Pop authored
      Rev 1978 introduced a breakage on the SIGKILL finall signal to the
      process, due to mistyped variable.
      
      Reviewed-by: francis.perron
      e1bd0072
  2. Nov 11, 2008
    • Michael Hanselmann's avatar
      ganeti.http: Implement SSL for HTTP client · 438a366a
      Michael Hanselmann authored
      Implementing SSL for the HTTP client required more work than I expected.
      For correct error handling, quite a lot of code is needed. To avoid
      code duplication, I moved a lot of the socket handling code into a
      single function named _SocketOperation. It takes care of the polling
      and error handling for OpenSSL. At the same time, the functions calling
      it become a lot smaller.
      
      This patch brings a few more changes:
      - Error handling for socket.connect_ex (e.g. name resolution failures)
      - Rename "ResponseError" exception class to "_HttpClientError" --
        it's an internal class anyway
      
      Reviewed-by: iustinp
      438a366a
    • Michael Hanselmann's avatar
      ganeti.daemon: Add timers to Mainloop · b11c9e5c
      Michael Hanselmann authored
      This is a fallout from my work on the HTTP client class. Repeating
      timers are prepared, but not yet implemented.
      
      Reviewed-by: iustinp
      b11c9e5c
    • Iustin Pop's avatar
      Convert trunk to posix-compatibility · d868edb4
      Iustin Pop authored
      We change two functions to use RunCmd without shell, and the other
      (which needs a ssh command line) is changed to the '>... 2>&1' syntax.
      
      Reviewed-by: imsnah
      d868edb4
    • Iustin Pop's avatar
      Abstract runtime creation of dirs into a function · 8adbffaa
      Iustin Pop authored
      Currently the dir creation in ganeti-noded is in the main function. This
      is not nice: we move it into a separate function and also add creation
      of the OS_LOG_DIR (with different permissions, but in the same way).
      This will permit cleanup of the creation of the OS_LOG_DIR from the
      backend module (it's done multiple places currently).
      
      Reviewed-by: imsnah
      8adbffaa
    • Iustin Pop's avatar
      Remove zombie special case from IsProcessAlive · 44bf25ff
      Iustin Pop authored
      Based on the discussion on the mailing list, we remove the special
      casing of zombie processes.
      
      Note we don't use kill -0 since that has a different meaning than "check
      process is alive", so this function is still linux-specific.
      
      Reviewed-by: imsnah
      44bf25ff
    • Iustin Pop's avatar
      Add cleanup of processes to utils.KillProcess · ff5251bc
      Iustin Pop authored
      In case the process we want to signal is our own process, and the signal
      we send is a deadly one, we should also cleanup after the process.
      
      This patch adds a new parameter waitpid to this function that does this,
      and changes its unittest to pass this new parameter.
      
      Reviewed-by: imsnah
      ff5251bc
    • Iustin Pop's avatar
      Fix instance rename · cb4e8387
      Iustin Pop authored
      As can be seen from the patch, we remove from the locking manager
      inst.name. However, we do this right after cfg.RenameInstance, which
      changes inst.name to the new name. So we need to remove old_name not
      the new name.
      
      The real question is why does the glm allow me to remove a not-existing
      instance name...
      
      The symptom before the patch was: run rename, then:
      $ gnt-instance list
      Unhandled protocol error while talking to the master daemon:
      Caught exception: 'NoneType' object has no attribute 'primary_node'
      
      Reviewed-by: imsnah
      cb4e8387
    • Iustin Pop's avatar
      Make the makefile not recreate ganeti every time · 01f3e7b1
      Iustin Pop authored
      Currently the makefile always recreates the ganeti symlink. Make it so
      that it does only when it doesn't exist or it's not a symlink.
      
      Reviewed-by: imsnah
      01f3e7b1
    • Iustin Pop's avatar
      Fix gnt-instance reinstall · bb2ee932
      Iustin Pop authored
      Commit 1881 changed a rpc call but didn't fix all its users. This should
      fix it (but I can't test as HTTP is broken).
      
      Reviewed-by: imsnah
      bb2ee932
    • Iustin Pop's avatar
      Implement working directory for utils.RunCmd · 8797df43
      Iustin Pop authored
      In order to replace usage of the shell just for 'cd %s; ...' we need to
      be able to specify the working directory for childs.
      
      The patch also changes the default working directory (when not
      specified) to "/", as opposed to the current dir; since the daemos run
      with cwd=/ anyway, this should not change things.
      
      Reviewed-by: imsnah
      8797df43
  3. Nov 10, 2008
  4. Nov 07, 2008
  5. Nov 06, 2008
    • Michael Hanselmann's avatar
      Add new HTTP client class · 8a0b06d2
      Michael Hanselmann authored
      It is based on the WorkerPool class which is already used for the job
      queue and master daemon. Each request must be encapsulated in an
      instance of HttpClientRequest, which will then be passed to
      HttpClientManager for processing. Upon completion, the request object
      contains the response or error message.
      
      While not yet enabled, the HTTP client implementation has been designed
      with HTTP/1.1 and keep-alive in mind. For now it only uses HTTP/1.0,
      though.
      
      HttpClientManager will likely need more changes when integrating with
      the RPC layer. SSL will also be integrated in a second step.
      
      Reviewed-by: iustinp, ultrotter
      8a0b06d2
    • Michael Hanselmann's avatar
      ganeti.http: Use 411 Length Required in server code · 64357ed8
      Michael Hanselmann authored
      Reviewed-by: iustinp
      64357ed8
  6. Nov 05, 2008
  7. Oct 27, 2008
  8. Oct 25, 2008
    • Iustin Pop's avatar
      Update backend.py docstrings · 10c2650b
      Iustin Pop authored
      This patch converts all of backend.py to epydoc formatting.
      
      Reviewed-by: imsnah
      10c2650b
    • Iustin Pop's avatar
      Fix another error handling case · 3f5bd234
      Iustin Pop authored
      The return from this error path is a dict, but the actual return value
      (on the non-error handling) is a list of dicts. Change accordingly.
      
      Reviewed-by: imsnah
      3f5bd234
  9. Oct 24, 2008
Loading