Skip to content
Snippets Groups Projects
  1. Aug 22, 2012
    • Dimitris Aragiorgis's avatar
      Introduce new module for IP pool management · 8e5f43b1
      Dimitris Aragiorgis authored
      
      Add new library module lib/network.py.
      Introduce new class: AddressPool.
      
      AddressPool implements all operations needed for managing IPs
      inside the IP pool.
      
      Given a Network config object (nobj), the class:
      
       * initializes the corresponding IP pool object via
         network.AddressPool.InitializeNetwork(nobj)
       * obtains the corresponding IP pool object via
         network.AddressPool(nobj)
       * manipulates IPs inside the pool
      
      Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
      8e5f43b1
  2. May 09, 2012
    • Iustin Pop's avatar
      Fix exception re-raising in Python Luxi clients · 98dfcaff
      Iustin Pop authored
      
      Commit e687ec01 (present in 2.5 since the 2.5 beta 3) did consistency
      fixes across the code-base. Unfortunately this was done without enough
      checks on the actual meaning of one of the fixes, which means error
      re-raising in lib/errors.py is broken.
      
      The problem is that:
      
        raise cls, args
      
      is different than:
      
        raise cls(args)
      
      And our unit-tests didn't catch this (this patch updates the tests).
      
      This breakage is usually trivial, like wrong error messages:
      
        $ gnt-instance remove no-such-instance
        Failure: prerequisites not met for this operation:
        ("Instance 'no-such-instance' not known", 'unknown_entity')
      
      versus:
      
        $ gnt-instance remove no-such-instance
        Failure: prerequisites not met for this operation:
        error type: unknown_entity, error details:
        Instance 'no-such-instance' not known
      
      or:
      
        $ gnt-instance add … no-such-instance
        Failure: prerequisites not met for this operation:
        ('The given name (no-such-instance) does not resolve: Name or service not known', 'resolver_error')
      
      versus:
      
        $ gnt-instance add … no-such-instance
        Failure: prerequisites not met for this operation:
        error type: resolver_error, error details:
        The given name (no-such-instance) does not resolve: Name or service not known
      
      But in some cases where we rely on a certain data representation
      (e.g. HooksAbort), this actually breaks because we try to iterate over
      the wrong type:
      
        File "/usr/lib/python2.6/dist-packages/ganeti/cli.py", line 1907, in FormatError
           for node, script, out in err.args[0]:
        ValueError: need more than 1 value to unpack
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      98dfcaff
  3. Apr 26, 2012
    • Michael Hanselmann's avatar
      errors: Add exception for RAPI testing utilities · 352e1a26
      Michael Hanselmann authored
      
      This exception is raised to abort before actually sending a LUXI call
      (there is no LUXI server involved in the test). The testing utilities
      catch the exception to report a success (i.e. the code didn't throw
      an exception before due to invalid types, etc.). To allow the exception
      to be thrown all the way to the test utilities, the HTTP server library
      must ignore it. Also some overly generic exception handling is removed
      from the RAPI request handler.
      
      Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      352e1a26
  4. Dec 08, 2011
  5. Oct 18, 2011
  6. Sep 20, 2011
    • Andrea Spadaccini's avatar
      Implementation of TLS-protected SPICE connections · b6267745
      Andrea Spadaccini authored
      
      Added support for TLS-protected SPICE connections:
      
      client/gnt_cluster.py, cli.py:
      * added three new parameters to renew-crypto (--new-spice-certificate,
        --spice-certificate, --spice-ca-certificate) and their validation.
      
      utils/x509.py:
      * changed GenerateSelfSignedSslCert so that now also returns the
        generated key and certificate;
      * added missing return value in the docstring of
        GenerateSelfSignedX509Cert.
      
      lib/bootstrap.py:
      * changed the signatures of the relevant functions and implemented
        certificates generation/writing.
      
      tools/cfupgrade:
      * changed GenerateClusterCrypto invocation to reflect the new signature;
      * added SPICE certificate names.
      
      lib/errors.py:
      * added the X509CertError class.
      
      lib/hypervisor/hv_kvm.py:
      * silenced pylint warning R0915
      
      Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      b6267745
  7. Aug 25, 2011
  8. Jul 26, 2011
  9. Apr 18, 2011
  10. Feb 15, 2011
  11. Jan 31, 2011
  12. Oct 28, 2010
  13. Oct 13, 2010
  14. Aug 18, 2010
    • Manuel Franceschini's avatar
      Introduce new IPAddress classes · 8b312c1d
      Manuel Franceschini authored
      
      This patch unifies the netutils functions dealing with IP addresses to
      three classes:
      - IPAddress: Common IP address functionality
      - IPv4Address: IPv4 specific functionality
      - IPv6address: IPv6-specific functionality
      
      Furthermore it adds methods to check whether an address is a loopback
      address, replacing the .startswith("127") for IPv4 and adding IPv6
      support.
      
      It also provides the basis for future IPv6 address handling. Methods to
      convert IP strings to their corresponding interger values will allow to
      canonicalize IPv6 addresses.
      
      Signed-off-by: default avatarManuel Franceschini <livewire@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
      8b312c1d
  15. Aug 17, 2010
  16. Jul 16, 2010
  17. Jul 07, 2010
  18. Jun 23, 2010
  19. May 21, 2010
  20. Dec 18, 2009
  21. Nov 06, 2009
  22. Nov 04, 2009
    • Iustin Pop's avatar
      Introduce a wrapper for hostname resolving · 104f4ca1
      Iustin Pop authored
      
      Currently a few of the LU's CheckPrereq use utils.HostInfo which raises
      a resolver error in case of failure. This is an exception from the
      standard that CheckPrereq should raise an OpPrereqError if the error is
      in the 'pre' phase (so that it can be retried).
      
      This patch adds a new error code (resolver_error) and a wrapper over
      utils.HostInfo that just converts the ResolverError into
      OpPrereqError(…, errors.ECODE_RESOLVER). It then uses this wrapper in
      cmdlib, bootstrap and some scripts.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      104f4ca1
  23. Nov 02, 2009
  24. Sep 25, 2009
  25. Sep 16, 2009
  26. Aug 28, 2009
  27. Aug 27, 2009
  28. Aug 10, 2009
  29. Jul 29, 2009
  30. Jul 14, 2009
  31. Jun 15, 2009
    • Iustin Pop's avatar
      Remove old invalid-os related functionality · 8e70b181
      Iustin Pop authored
      
      We no longer need OS objects to be able to represent invalid OSes. This
      cleans up the code handling those cases.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      8e70b181
    • Iustin Pop's avatar
      Conver node_leave_cluster rpc to new style result · 0623d351
      Iustin Pop authored
      
      This patch converts this rpc call to the new style result, and also
      changes in the process the meaning of the QuitGanetiException's
      arguments and the node daemon rpc call exception handler.
      
      The problem with the exception handler is that we used a two-stage one,
      and the inner used to catch all exception (including this one), so in
      the logs we always had an exception logged, instead of the normal
      'leaving cluster message'. The patch also adds logging of the
      exception's arguments, so that we have a trail in the logs about the
      shutdown mode.
      
      The exception's arguments were reversed from the normal RPC results
      style. While it makes somewhat more sense for this exception, we change
      them such that they match the rpc result format.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      0623d351
  32. Feb 10, 2009
    • Guido Trotter's avatar
      Instance parameters: force typing · a5728081
      Guido Trotter authored
      We want all the hv/be parameters to have a known type, rather than a
      random mix of empty string, boolean values, and None, so we declare the
      type of each variable and we enforce/convert it.
      
      - Add some new constants for enforceable value types
      - Add new constants dicts HVS_PARAMETER_TYPES and BES_PARAMETER_TYPES
        holding not only the valid parameters but also their types
      - Drop the old HVS_PARAMETERS and BES_PARAMETERS constants and calculate
        the values from the type dict
      - Convert all the default parameters to a valid type value
      - Create a new ForceDictType utils function, to check/enforce a dict's
        element value types, with relevant unit tests
      - Drop a few custom functions to check/convert the BE param types in
        utils and cli, in favor of ForceDictType
      - Double-check the parameter types using ForceDictType in both scripts
        and LogicalUnits, when possible.
      
      As a bonus:
      - Remove some old commented-out code in gnt-instance
      - Remove some already fixed FIXME
      - Fix a bug which prevented VALUE_DEFAULT to be applied to BE parameters
        in SetInstanceParams because the value was checked for validity before
        that transformation was made
      - Fix a bug which prevented initing a cluster and passing hvparams to
        work at all
      - ForceDictType allows an allowed_values for exceptions, which makes us
        able to do the checking even when some values must not be
        converted/typechecked (for example the 'default' string in
        SetInstanceParameters)
      
      Reviewed-by: iustinp
      a5728081
  33. Dec 17, 2008
    • Michael Hanselmann's avatar
      Add job queue size limit · f87b405e
      Michael Hanselmann authored
      A job queue with too many jobs can increase memory usage and/or make
      the master daemon slow. The current limit is just an arbitrary number.
      A "soft" limit for automatic job archival is prepared.
      
      Reviewed-by: iustinp
      f87b405e
  34. Dec 11, 2008
    • Iustin Pop's avatar
      Fix epydoc format warnings · c41eea6e
      Iustin Pop authored
      This patch should fix all outstanding epydoc parsing errors; as such, we
      switch epydoc into verbose mode so that any new errors will be visible.
      
      Reviewed-by: imsnah
      c41eea6e
  35. Oct 15, 2008
Loading