1. 11 May, 2012 15 commits
  2. 10 May, 2012 17 commits
  3. 09 May, 2012 6 commits
    • Iustin Pop's avatar
      Add a default PATH variable to OS scripts env · 9a6ade06
      Iustin Pop authored
      In commit 896a03f6
      
       I cleaned up the environment for OS scripts,
      however I think that was a bit too extreme - it breaks our own
      instance-debootstrap hooks, because for example dpkg (called from the
      grub script) requires PATH to be set.
      
      Instead of requiring every OS to define a path, let's set a default
      PATH for the OS scripts, which should cover most common uses. A more
      specialised PATH can be set, if needed, in the OS scripts.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      9a6ade06
    • Andrea Spadaccini's avatar
      Move hooks PATH environment variable to constants · aa7b59ac
      Andrea Spadaccini authored
      
      
      Move the contents of the PATH environment variable for hooks to
      constants, and use its value in the code and in the hooks documentation.
      Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      (cherry picked from commit fe5ca2bb
      
      )
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      aa7b59ac
    • Iustin Pop's avatar
      Add note to the install doc about bridge MAC issues · 12f9d75e
      Iustin Pop authored
      
      
      Thanks to Faidon Liambotis for explaining this on the external IRC
      channel.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarFaidon Liambotis <paravoid@gmail.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      12f9d75e
    • 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
    • Iustin Pop's avatar
      Allow clock skews in certificate verification · f97a7ada
      Iustin Pop authored
      
      
      Currently we allow for up to NODE_MAX_CLOCK_SKEW time difference
      between nodes in some operations, but not everywhere: SSL certificate
      verification (import/export, both intra and inter-cluster) has a zero
      limit (downwards), and a week upwards. This can cause even
      intra-cluster backup problems, if the source node has a time even two
      seconds in the future.
      
      To fix this, when we verify certificates compare with a time offset
      with the max skew, which fixes the lower bound and reduces the upper
      bound by an insignificant amount (0.04%).
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      f97a7ada
    • Iustin Pop's avatar
      Improve formatting in the hooks documentation · ff779c32
      Iustin Pop authored
      
      
      The pyeval role generates literal (e.g. ``OP_CLUSTER…``) formatting,
      which differs from the other headers. This is confusing, so let's add
      a note that these are virtual operations, which makes the output more
      consistent.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
      ff779c32
  4. 08 May, 2012 2 commits
    • Iustin Pop's avatar
      Add decoding of Luxi calls and unittests for LuxiOp · cdd495ae
      Iustin Pop authored
      
      
      This patch adds a hand-coded decoder for LuxiCall arguments, as the
      data-structure is not uniform enough for automated generation (even
      for the serialisation, we had to add hints for some fields,
      de-serialisation is even harder).
      
      It also fixes a tiny issue with WaitForJobChange job ID encoding, and
      adds unittests for the encoding/decoding of LuxiOp structures.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      cdd495ae
    • Iustin Pop's avatar
      Some unit tests improvements · 5cefb2b2
      Iustin Pop authored
      
      
      In preparation for unit-testing the Luxi definitions, this improves
      the auto-generation of OpCodes: currently this uses unbounded plain
      Strings for names and fields, and this creates too big test sizes
      (e.g. when automatically generating job sets).
      
      Furthermore, there are some more cleanups: switching from liftM to
      applicative style for easier definition, and some improvements in
      generators.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      5cefb2b2