- Jan 28, 2008
-
-
Iustin Pop authored
The gnt-node and gnt-instance list commands have a customizable list of output fields, but the list is not up to date (in the man page) and not easily understandable from the ‘--help’ output. This patch updates the man pages and adds the available fields and default fields in the ‘--help’ output, as part of the description. Example: Usage ===== gnt-node list Lists the nodes in the cluster. The available fields are (see the man page for details): name, pinst_cnt, pinst_list, sinst_cnt, sinst_list, pip, sip, dtotal, dfree, mtotal, mnode, mfree, bootid. The default field list is (in order): name, dtotal, dfree, mtotal, mnode, mfree, pinst_cnt, sinst_cnt. Reviewed-by: imsnah,ultrotter
-
- Jan 25, 2008
-
-
Guido Trotter authored
It was wrongly deleted when converting if a in dict.keys(): to if a in dict: Reviewed-by: imsnah
-
- Jan 21, 2008
-
-
Guido Trotter authored
Passing a new aliases dict to generic main we can easily support aliases for compatibility reasons or simply useability. Reviewed-by: iustinp
-
- Dec 12, 2007
-
-
Iustin Pop authored
When waiting for the lock and pressing ^C, the user will get a backtrace as the KeyboardInterrupt exception is not handled. The patch adds a simple method of handling it. Note that this is not about ^C in any other place. Reviewed-by: schreiberal,imsnah
-
- Nov 29, 2007
-
-
Iustin Pop authored
This patch adds logging of command failures to the debug log in case the user either started the command (gnt-*) or the node daemon with the debug flag. Reviewed-by: imsnah
-
- Nov 06, 2007
-
-
Michael Hanselmann authored
Replace --secondary-node option with an optional parameter for --node.
-
- Nov 05, 2007
-
-
Iustin Pop authored
Reviewed-by: ultrotter
-
Iustin Pop authored
This patch fixes some minor pylint warnings (unused variables, wrong indentation, etc.) and a real bug in the recovery for drbd8 rename procedure. Reviewed-by: imsnah
-
- Oct 29, 2007
-
-
Iustin Pop authored
This patch moves the passing of the feedback_fn argument from the (Exec|Chain)OpCode to the initialization of the Processor instance. Reviewed-by: imsnah
-
- Oct 10, 2007
-
-
Iustin Pop authored
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
-
Iustin Pop authored
Currently, AskUser dies with -ESPIPE if the user gives more than one character plus newline. This is because the python library, while returning only two chars from the readline(2) call, will cache the rest of the input, and when we do a write, it will try to seek back to just after the last returned char. This fails on /dev/tty, so an exception is raised. However, then opening the file descriptor in O_APPEND mode, python will not issue such seeks, thereby fixing this problem. The other alternative, opening in unbuffered mode, is not as good, since then python will issue one-byte reads at a time, but the tty will read the entire line, so at the next readline call, whatever remained in the descriptor buffer is returned from the kernel to python, and the user doesn't get a chance to enter something at all. Reviewed-by: imsnah
-
Iustin Pop authored
Since modules are not directly executables, remove the shebang from them. This helps with lintian warnings. Also make the autogenerated _autoconf.py contain two comment lines at the beginning, like the other modules. Reviewed-by: ultrotter
-
- Oct 09, 2007
-
-
Iustin Pop authored
This was introduced in rev 208. Reviewed-by: imsnah
-
Iustin Pop authored
This patch moves the error formatting into a separate function that will be exported so that scripts that execute multiple opcodes can create the same output as for GenericMain. Also, GenericMain becomes more readable. Reviewed-by: imsnah
-
Iustin Pop authored
This patch allows the SubmitOpcode function to take a pre-created Processor instance and a different feedback function. This is helpful when submitting more than one opcode from a shell script. Reviewed-by: imsnah
-
- Oct 08, 2007
-
-
Iustin Pop authored
This patch adds a simple handler for TagError that prints the error (better than having a stack dump). Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds a '--from' option to the {add,remove}-tags commands that allows the command to read from a file or from stdin (when passing a dash for the filename). Reviewed-by: imsnah
-
Iustin Pop authored
This patch adds generic functions for tag manipulations to cli.py and modifies gnt-{cluster,node,instance} to export {list,add,remove}-tags commands that use those. Reviewed-by: imsnah
-
Iustin Pop authored
This allows scripts to pass options to generic functions (options that are not visible in the command line). Reviewed-by: imsnah
-
- Sep 21, 2007
-
-
Iustin Pop authored
We currently require that hostnames are FQDN not short names (node1.example.com instead of node1). We can allow short names as long as: - we always resolve the names as returned by socket.gethostname() - we rely on having a working resolver These issues are not as big as may seem, as we only did gethostname() in a few places in order to check for the master; we already required working resolver all over the code for the other nodes names (and thus requiring the same for the current node name is normal). The patch moves some resolver calls from within execution path to the checking path (which can abort without any problems). It is important that after this patch is applied, no name resolving is called from the execution path (LU.Exec() or other code that is called from within those methods) as in this case we get much better code flow. This patch also changes the functions for doing name lookups and encapsulates all functionality in a single class. The final change is that, by requiring working resolver at all times, we can change the 'return None' into an exception and thus we don't have to check manually each time; only some special cases will check (ganeti-daemon and ganeti-watcher which are not covered by the generalized exception handling in cli.py). The code is cleaner this way. Reviewed-by: imsnah
-
- Sep 19, 2007
-
-
Iustin Pop authored
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: root@xen-test1-4:~# gnt-instance remove tsetest1 This will remove the volumes of the instance tsetest1 (including mirrors), thus removing all the data of the instance. Continue? y/[n]/?: ? y - Perform the operation n - Do not perform the operation This will remove the volumes of the instance tsetest1 (including mirrors), thus removing all the data of the instance. Continue? y/[n]/?: y The patch also removed the _ask_user member of the opts argument, since external code was using it (and thus it makes no sense for it to be a private member); now gnt-* scripts are using the AskUser function directly. Reviewed-by: ultrotter
-
- Aug 17, 2007
-
-
Iustin Pop authored
Since the table generation might be useful elsewhere, let's change it to return the data instead of directly printing it. Its callers have also been updated. Reviewed-by: imsnah
-
- Aug 14, 2007
-
-
Iustin Pop authored
This changes the raising of exceptions from: raise Exception, value to raise Exception(value) as the first form will be removed in python-3000 and the second form is preferred now. The changes also involve a few cases of changing from raising standard exceptions and use our own ones. The new version also fixes many pylint-generated warnings, especially in ganeti-noded where I changed many methods to @staticmethod. There is no functionality changed (barring any bugs).
-
- Jul 26, 2007
-
-
Michael Hanselmann authored
- Implement “gnt-instance reinstall” - Fix two typos Reviewed-by: iustinp
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
- Jul 24, 2007
-
-
Michael Hanselmann authored
Reviewed-by: iustinp
-
Michael Hanselmann authored
- Create all --output options using a constant - Put node checking code from opcodes into a single function - Do the same for output fields Reviewed-by: iustinp
-
- Jul 16, 2007
-
-
Iustin Pop authored
-