Skip to content
Snippets Groups Projects
  1. Aug 23, 2012
    • Iustin Pop's avatar
      Bump pep8 version to 1.2 · 5ae4945a
      Iustin Pop authored
      
      Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
      
      - bump version in the docs
      - silence some new checks that are wrong due to our indent=2 instead of 4
      - fix lots of errors in the code where the indentation was wrong by 1
        or 2 spaces
      - fix a few cases of == True, False, None and replace with 'is'
      - re-indent some cases where the code is OK, but pep8 complains
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      5ae4945a
    • Iustin Pop's avatar
      Change node parameter oob_program to VTYPE_STRING · 1df4d430
      Iustin Pop authored
      
      Since this is an inheritable parameter, having it as a MABYE_STRING
      creates only problems (per our derivation rules). We change it to
      STRING, with the default "", meaning no program. Note that most of the
      code already accepts this as valid for "no program", and some comments
      even say that this is the expected value.
      
      We have some other parameters like this, I'll have to investigate
      whether they need to be changed too. But right now I need this for the
      hconfd changes (it's a prerequisite for them, I forgot to send it in
      that patch series).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      1df4d430
  2. Aug 14, 2012
  3. Aug 13, 2012
    • Iustin Pop's avatar
      Add a server-side Luxi implementation · 13f2321c
      Iustin Pop authored
      
      This is a trivial code change, but it allows us to finally test the
      send-receive code on both client and server sides via a simple
      in-process server.
      
      The unittest works, but it won't handle timeouts very nicely; it will
      wait until the actual Luxi timeout expires, instead of using much
      shorter timeouts as we could in the same process.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      13f2321c
    • Iustin Pop's avatar
      Switch the Luxi interface from Strings to ByteStrings · e821050d
      Iustin Pop authored
      
      I'm doing this change for future performance optimisations. Currently
      we use the Luxi interface just as a client, so not in the hot path,
      but when we'll use this as a server interface, we're interested to
      both reduce the space and time consumption of the interface.
      
      We have to simultaneous changes here:
      
      - switch from using socket-related function (sendto, recv, etc.) to
        handle-based functions, since the standard network library doesn't
        work with sockets
      - switch from using Strings for the internal buffer to strict
        ByteStrings; the only downside is that we now have the issue of
        decoding/encoding from binary to UTF-8 strings, a fact which brings
        its own issues into the mix (we have to check for failed decodings,
        etc.); but this is similar to what we'll have to handle on the
        Python side when moving to Python 3.x
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      e821050d
  4. Aug 07, 2012
  5. Aug 02, 2012
    • Iustin Pop's avatar
      Fix uses of OpPrereqError without code info · 2cfbc784
      Iustin Pop authored
      
      A while back, we did cleanup the code and ensured (manually) that use
      of OpPrereqError includes an errors.ECODE_* field as second
      argument. Since we cannot automate the check for this, it turns out
      that more and more such usage has crept over the years, including in
      the master code (the use on the CLI side is not as important).
      
      Note that this also uncovered a few errors in ovf.py where the errors
      messages were wrongly constructed.
      
      Still looking for a way to automate this check…
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      2cfbc784
  6. Jul 31, 2012
  7. Jul 25, 2012
  8. Jul 23, 2012
    • Iustin Pop's avatar
      Build epydoc.conf using standard replace_vars_sed · fc1282b8
      Iustin Pop authored
      
      This is just begging to be converted to a standard replace_vars_sed
      rule, instead of custom sed calls.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      fc1282b8
    • Iustin Pop's avatar
      Simplify some make rules · 55398706
      Iustin Pop authored
      
      A rule of type "a/%: a/%.in" will also match "a/b/%: a/b/%.in", so no
      need for the explicit examples/hooks rule. As for the man rules, they
      are identical and thus can be collapsed.
      
      We still have the problem that globally, not all our %.in to %
      transformations are identical; this is suboptimal and should be
      cleaned sometime…
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      55398706
    • Iustin Pop's avatar
      Explicitly terminate some make rules · 490bec02
      Iustin Pop authored
      
      Generic rules like:
      
        %: %.in
      
      have the downside that the source (%.in) itself matches the target
      (via %.in: %.in.in). This leads to things like:
      
        Looking for a rule with intermediate file `doc/examples/hooks/ipsec.in.in'.
         Trying pattern rule with stem `ipsec.in.in'.
         Trying implicit prerequisite `doc/examples/hooks/ipsec.in.in.in'.
         Trying pattern rule with stem `ipsec.in.in'.
         Trying implicit prerequisite `doc/examples/hooks/ipsec.in.in.in'.
         Looking for a rule with intermediate file `doc/examples/hooks/ipsec.in.in.in'.
        Rejecting impossible implicit prerequisite `doc/examples/hooks/ipsec.in.in'.
      
      To fix this, we need to tell make that such rules are terminating, so
      that it doesn't recurse into them.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      490bec02
    • Iustin Pop's avatar
      Remove ancient implicit make rules · 1d45f7a0
      Iustin Pop authored
      
      GNU Make contains some (ancient) implicit rules, that try to
      _automatically_ extract source files from RCS/SCCS version control
      systems. This is unneeded, and it pollutes the make -d output
      significantly: after removing these rules (by defining empty targets
      for their patterns), make -d line count goes from 5.3K to 3.3K.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      1d45f7a0
    • Iustin Pop's avatar
      Stop using BUILT_SOURCES · 4c3d5fb6
      Iustin Pop authored
      
      Commit dc7d2c49 introduced the use of BUILT_SOURCES to work around
      missing dependencies. However, on closer reading of the gmake manual,
      BUILT_SOURCES is mainly used in cases where the dependencies are not
      know before the build starts (e.g. with auto-generated C header
      files). Additionally, there are a number of drawbacks to
      BUILT_SOURCES, which we already had to work around (e.g. in commit
      eb732fb5).
      
      Since we know all our dependencies statically, there's no need to use
      this special variable. Let's rename it to GENERATED_FILES, which
      doesn't have a special meaning to make, and add a few missing
      dependencies (one of which was already broken by make -j on a clean
      tree).
      
      After this change, running make in a fully built tree is finally "clean":
      
        $ make
        make: Nothing to be done for `all'.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      4c3d5fb6
    • Iustin Pop's avatar
      Change how we create the 'ganeti' symlink · 924ecd85
      Iustin Pop authored
      
      Currently, if one runs 'make' in an already fully-built tree, this is
      the result:
      
        cd . && test -h "ganeti" || { rm -f ganeti && ln -s lib ganeti; }
        make  all-am
        make[1]: Entering directory `/tmp/test'
        cd . && test -h "ganeti" || { rm -f ganeti && ln -s lib ganeti; }
        make[1]: Leaving directory `/tmp/test'
      
      This is because commit dc7d2c49 added 'ganeti' (which is a PHONY
      target) to BUILT_SOURCES, and since that is a dependency of other,
      real targets, it means the ganeti target is always remade.
      
      To fix this, we keep ganeti as a PHONY target, but we remove it from
      the 'built_base_sources' target, and instead we only remake it
      manually in the stamp-directories target. A make run now is just:
      
        make  all-am
        make[1]: Entering directory `/tmp/test'
        make[1]: Nothing to be done for `all-am'.
        make[1]: Leaving directory `/tmp/test'
      
      Note that we can't get rid of the all-am since we use BUILT_SOURCES.
      
      We also remove the comment of BUILT_SOURCES since it no longer depends
      on PHONY targets.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      924ecd85
    • Iustin Pop's avatar
      Partial undo of "Makefile: Streamline directory creation" · 3735787e
      Iustin Pop authored
      
      Commit c964d962 changed the way we create directories, by two things:
      
      - unifying all dependencies and ad-hoc directory creation into a
        single target (all_dirfiles)
      - changing how directories are created from a stamp file to .dir files
        in each directory
      
      The first item is a very good one, but the second item is debatable:
      there's no per-se advantage of .dir files versus a single one,
      top-level, since both the .dir file and stamp-directories creation are
      depending on Makefile, which is the only one which can introduce new
      directories.
      
      On the other hand, moving back from .dir files to stamp-directories
      has an advantage: "make -d | wc -l" does from ~8.7K lines to ~5.3K
      lines, because we eliminate the many .dir files and their multiple
      implicit and explicit dependencies (the %/.dir files fall under
      multiple patterns).
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      3735787e
    • Iustin Pop's avatar
      A few style fixes in Makefile.am · 5098afd1
      Iustin Pop authored
      
      Seen while debugging make rules.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      5098afd1
  9. Jul 20, 2012
  10. Jul 19, 2012
Loading