Implement support for multi-module export
This add support for exporting constants from multiple modules (asopposed to hard-coding constants), and also makes the output morereadable by skipping things we know for sure we don't want to convert(as opposed to things we would like to but don't know how to...
Implement reverse mapping of values to names
This adds a bit of dumb mapping of values to names, while trying to besafe. This is the best we can do without resorting to parsing orinterpreting ASTs.
The difference in the output is:
-- | Converted from Python list or set ADMINST_ALL...
QA: Enable use of OR conditions in test checks
Until now “TestRunIf” and “TestEnabled” could only handle AND. With thispatch a new class named “Either” is added to “qa_config” and allows OR.The name “Either” was chosen instead of “Or” as the latter is very close...
Add example script for using RAPI test utilities
This script shows a few examples on how to use the RAPI input testclient. It is also run at “make check” time to ensure it's notcompletely broken.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename htools-hpc to hpc-tools to fix laziness
This is a stupid/trivial patch. I didn't realise when addinghtools-hpc that this will "break" tab completion on htools; as in, Iwill have to add / manually always when completing files on thecommand line....
Build a coverage-enabled version of the tools
This allows the offline tests to also generate coverage data, and thehs-coverage target is changed to show both unit-test and offline-testscoverage.
The downside is that now we build yet-another-binary, which makes the...
Enable htools offline tests as Haskell tests
This enables the offline-test.sh run both in the special "hs-check" rule and during normal "make check".
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Split check-man-warnings into two
This moves the dashes check to a new check-man-dashes script.
Rename check-man to check-man-warnings
Currently the check-man test is dependent on the MAN_HAS_WARNINGStest, which made sense as long as the script only did the warningscheck.
However, we should run the [em] tests always, and in general we couldrun other tests too, even if man doesn't support --warnings; so let's...
Add automated checking for non-escaped --
This checks to see if any man output has [em] in it, as that will notbe correctly show in ASCII. Unfortunately the check will depend onwhether the other man check is done, but I didn't want to introduceyet another short script for this (can be done, no issue)....
Add support for RE patterns to convert constants
This is a trivial conversion.
Add support for lists/frozensets in convert-constants
Unfortunately, we only support lists of simple types, and not evenlists of tuples. If we actually needed those, it would be possible toimplement them, with a bit more complexity in the converter.
Signed-off-by: Iustin Pop <iustin@google.com>...
Add support for tuples in convert-constants
More improvements to convert-constants
This prepares for tuple and other conversions.
Improve convert-constants to handle dictionaries
The two main drawbacks for convert-constants are the fact that itcan't handle sets/frozensets (mainly due to the fact that I don't knowhow useful this would be to the Haskell code) and that it cannotexport dictionaries....
gen-coverage: Change filter
It is not necessary to run a Python script to generate the filter, whichdidn't work very well anyway on systems with modules in/usr/share/pyshared.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
check-news/NEWS: impose more standards
- Always two empty lines before a version.- Standardize how version names should be called.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
rpc: Add support for resolver options callback
This adds support for a callback returning name resolver options. Thisis required for powercycling offline nodes. While it would be possibleto implement this using a separate RPC client class, doing so would...
Fix failure in distcheck and coverage tests
autotools/testrunner was missing in distcheck. Now some changes from7004106119c5c56c93085ccfb1250b3561b5b6ad have been reverted, and testrunneris not built anymore. coverage now uses fakeroot when needed.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
unit tests: added fakeroot support
Tests ending in "-runasroot" or "-runasroot.py" are run through fakeroot,so activity that needs root privileges can be tested.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
Extend RPC definition change with another parameter
This will be used in a later patch for parameter pre-processing. Fornow we just add the parameter as 'None' and add a consistency checkfor the parameter definitions.
build-rpc: Fail if call is defined more than once
check-python-code: Detect old-style pylint disable-msg lines
Commit b459a848d was supposed to replace all, but one was missed. Add acheck to autotools/check-python-code.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
rpc: Fix issue with “test_delay”'s timeout
I passed the timeout calculation function in the wrong field of thedefinition. A small change is also needed in “build-rpc” to not abortwhen writing the docstring.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
RPC/test_delay: Use callable for timeout calculation
This avoids having to override the function in the RPC runner.
rpc: Move post-processor functions into definitions file
This way the generated code no longer contains arbitrary code.Post-processing functions are used by reference.
rpc: Use definitions directly instead of via generated code
Until now “autotools/build-rpc” would read the definition of all RPCsand write them to a new file, “lib/_generated_rpc.py” with somemodifications. With this patch the generated code loads the definitions...
Convert RPC definitions to dictionaries
This is in preparation to reducing the amount of generated code.
Fix pylint deprecated directive in check-header
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add tool to check Python file headers
Ensures licence and copyright headers are correct.
rpc: Improve argument definitions
Instead of in-place code now each argument has an (optional) kindassigned. The RPC client will then take care of encoding each argumentaccording to its definition. A new base (_RpcClientBase) is added totake care of encoding and dispatching calls....
Add script to generate RPC wrappers
A new script, “autotools/build-rpc”, will be used to generate code forRPC client wrappers. This is done because “lib/rpc.py” contains lots andlots of boilerplate code. Forthcoming patches will start convertingRPC wrappers....
Generalize docpp and sphinx_ext
Add error codes documentation
Merge branch 'devel-2.5'
Add check for standalone modules' imports
This check will abort if one of the standalone modules (currentlylib/rapi/client.py and tools/ganeti-listrunner) imports anything fromthe Ganeti source directory.
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
check-python-code: Give location(s) of lines longer than 80 chars
Until now it would only say that there was a line longer than 80characters, but not where.
bash completion: Shorten function names
This saves another 5 kB from the generated script. An old debug commentwritten to the generated output is also removed.
check-news: Show per-file line number
… not the global line number.
bash completion: Group commands by arguments and options
This grouping, which was a TODO for a long time, reduces the script sizeby about 5kB.
Check option name format when building bash completion
This is just a style check. Option names should be consistent. Since allof them go through the “build-bash-completion” script, this seemed to bea good place.
Fix some issues in htools apidoc generation
First, auto-generated files were not processed if HsColour thus the'source' link in Haddock documentation was dangling.
Second, we document the original Python constant name in theGaneti.Constants source, so that it's easily retrievable (as opposed...
Implement conversion of Python constants to Haskell
With the merge of the repositories, we can now auto-generate the codefor Haskell constants from the Python code.
Currently this only handles the basic types (strings andintegers). Handling containers such as lists and dictionaries is only...
Enable htools unittests and coverage reports
Since we have two sets of coverage data, we make the namingconsistent:
- doc/py-coverage for Python coverage- doc/hs-coverage for Haskell coverage
We also need to exclude some more dirs from the list of checked...
Add script to generate query fields documentation
- All lines matching "QUERY_FIELDS_${resource}" in the input will be replaced with a definition list describing the fields for $resource- The core code is kept in the Sphinx extension, so that it could be...
QUERY_FIELDS_${resource}
Add script checking release dates in NEWS
This will detect human errors when setting a release date in NEWS.
Build epydoc's module list from Makefile
Querying node groups: add client/gnt_group.py
This implements `gnt-group list`.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.3'
Conflicts: Makefile.am
Merge branch 'devel-2.2' into devel-2.3
Correct version check for release candidates
The tilde needs to be escaped and I forgot the space which should beused instead.
Check for editor-specific settings at build time
Fix version check
Don't ask … all I say is distcheck.
Add script to check version format
Only versions of the format “x.y.z” and “x.y.z~(rc|beta)N” (for N>0) areallowed.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix coverage reports
Currently, the coverage reports include the unittests themselves, andthis skewes unfairly the reports, as the coverage for the tests is veryhigh (since they all run).
To fix this, we export the ganeti temp dir from run-in-temp-dir, and we...
Remove last vestiges of docbook
This patch removes the last traces of docbook.
Conflicts: Makefile.am: Trivial
Makefile: Add new dist target for releases
A new script, autotools/check-tar, is used to check the resulting.tar.gz file for unwanted contents like wrong file owners orpermissions.
Add nodegroup bash autocomplation
We autocomplete both by nodegroup name and uuid.
cli: Use list of options shared between commands
The completion script for bash has to know about these options. Until nowthe list was in two places--once in cli.py and once inautotools/build-bash-completion. A shared list is used with this patch.
Move ShellWriter class to utils
Also add unittest.
Second attempt at fixing check-man
I was wrong, actually LANG-vs-LC_ALL only fixed one case, by mistake. Toget proper UTF-8 encoding, we need to enforce any UTF-8 locale. Wechoose the 'default' of en_US.UTF-8.
Fix check-man for newer man-db
Again, check-man :)
Commit 5fa1642226 removed LC_ALL=C, since that breaks the check.However, with no LANG/LC_* variables, man-db is still broken.
We import the new lintian behaviour, i.e. LANG=C (which seems to differfrom LC_ALL=C, even with empty environment). I'm not sure of the...
Introduce a bool CLI option type
This option type enforces its value to either True or False, relievingthe scripts from manually parsing the values in each function.
We also update the bash completion code to use the option type ifpossible.
Fix two issues related to check-man
First, we don't need to check man pages at sed time, because this meanseveryone building the package will do - we only need to check at docbooktime, which is mostly at developer time.
Second, don't force LC_ALL to C, as this breaks newer man-db. I've...
Add unittest for daemon-util
This test doesn't cover everything, but it's better than nothing.
Add support for non-Python unittests
cli: Add ArgOs for later use in gnt-os
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add make target to generate unittest coverage report
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Skip line-length warnings in man
Check built manpages for errors
One fix is necessary in gnt-cluster.sgml. Also adding “DELETE_ON_ERROR”target to remove output file if an error occurred while building it (inthis case the manpage).
This was reported by Iustin Pop in issue 87 and proposed check method...
build-bash-completion: Take care of pylint warnings
build-bash-completion: Fix a few pylint warnings
check-python-code: Use “set -e” to abort on errors
build-bash-completion: Check for None before comparing
Comparing a number with None is not a good idea:
>>> (0 < None, 0 > None) (False, True)
This patch also adds build-bash-completion to the listof checked Python scripts and wraps one line of more...
Revert "Backport AC_PATH_PROGS_FEATURE_CHECK"
This reverts commit 52b699ecaa688a2aaac00fa64558e249d0bc9a26.
Backport AC_PATH_PROGS_FEATURE_CHECK
In order to allow working with older versions of autoconf we backportthis macro, but only if it's not defined already (by autoconf itself).
This commit can be reverted after we decide support for autoconf 2.61and below should be deprecated....
bash_completion: Move common code into function
This reduces the size of the script by about 9 kB.
Disallow "xrange" function
check-python-code: Show line number for problems
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Remove explicit DEBUG_OPT and add it by default
Since >90% of the commands take the “--debug” option, and all shouldactually take it (the gnt-job command is currently missing it), it makessense to simply remove this and add it by default in cli.py.
Show "--help" in bash completion
check-python-code: Report EOL whitespace
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Check for tabs and long lines in Python code
Move LoadModule function to ganeti.build
It should only be used at build-time.
Add bash completion for --node node1[:node2]
Add more debugging to bash completion
Move LoadModule function to utils
It can be used by unittests for daemons/* or scripts/*.
Bash completion: Implement dynamic option value completion
Bash completion: Add function to get all iallocators
Bash completion: Simplify option completion
This makes the output file quite a bit smaller and is neededin preparation for non-static option completion (e.g. list ofnodes).
Bash completion: Support for --foo=bar option format
That is with the equal sign.
Bash completion: Small optimizations
$2 doesn't contain the correct value when completing something like"--disk-template=…". Getting it via COMP_WORDS is better.
Short options (e.g. -I) can't have an equal sign.
Also add useful debugging commands for development....
bash completion: Allow arguments with min < max arguments
Add script to run build commands in temporary directory
Python always compiles imported modules. By running these targetsin a temporary directory we don't pollute the source tree.