History | View | Annotate | Download (16.1 kB)
Some small fixes to utils.GenerateTable
This adds: - fix the case when a dumb caller didn't stringify its values - explicitly raise a ProgrammerError in case a field is missing from the headers dictionary
Reviewed-by: imsnah
Fix AskUser to not die on extra input
Currently, AskUser dies with -ESPIPE if the user gives more than onecharacter plus newline. This is because the python library, whilereturning only two chars from the readline(2) call, will cache the restof the input, and when we do a write, it will try to seek back to just...
Remove the shebang from modules
Since modules are not directly executables, remove the shebang fromthem. This helps with lintian warnings.
Also make the autogenerated _autoconf.py contain two comment lines atthe beginning, like the other modules.
Reviewed-by: ultrotter
Fix a wrong exception name
This was introduced in rev 208.
Separate error formatting out of cli.GenericMain
This patch moves the error formatting into a separate function that willbe exported so that scripts that execute multiple opcodes can create thesame output as for GenericMain. Also, GenericMain becomes more readable....
Enhance cli.SubmitOpcode to use custom parameters
This patch allows the SubmitOpcode function to take a pre-createdProcessor instance and a different feedback function. This is helpfulwhen submitting more than one opcode from a shell script.
Add handler for errors.TagError
This patch adds a simple handler for TagError that prints the error(better than having a stack dump).
Add source file option for {add,remove}-tags
This patch adds a '--from' option to the {add,remove}-tags commands thatallows the command to read from a file or from stdin (when passing adash for the filename).
Implement command-line tags support
This patch adds generic functions for tag manipulations to cli.py andmodifies gnt-{cluster,node,instance} to export {list,add,remove}-tagscommands that use those.
Extend GenericMain with a way to override options
This allows scripts to pass options to generic functions (options thatare not visible in the command line).
Remove requirement that host names are FQDN
We currently require that hostnames are FQDN not short names(node1.example.com instead of node1). We can allow short names as longas: - we always resolve the names as returned by socket.gethostname() - we rely on having a working resolver...
Improve the cli.AskUser() function
This patch improves the AskUser function by allowing it to: - choose from multiple choices (instead of only y/n) - give help to the user - preserve line breaks and whitespace formatting in the message
With this patch, an instance removal looks like this:...
Change cli.OutputTable to cli.GenerateTable
Since the table generation might be useful elsewhere, let's change it toreturn the data instead of directly printing it.
Its callers have also been updated.
Style changes for pep-8 and python-3000 compliance.
This changes the raising of exceptions from: raise Exception, valueto raise Exception(value)
as the first form will be removed in python-3000 and the second form ispreferred now.
The changes also involve a few cases of changing from raising standard...
- Move --force option to cli.py- Implement “gnt-instance reinstall”- Fix two typos
Reviewed-by: iustinp
Comment formatting updates.
Use generic function to output tables.
- Implement “gnt-node volumes”- Create all --output options using a constant- Put node checking code from opcodes into a single function- Do the same for output fields
Initial commit.