Statistics
| Branch: | Tag: | Revision:

root / lib / cli.py @ 5675cd1f

History | View | Annotate | Download (18 kB)

# Date Author Comment
e2212007 07/14/2008 04:38 pm Iustin Pop

Improve cli.SubmitOpCode

Currently, the feedback_fn argument to SubmitOpCode is no longer used.
We still need it in burnin, so we re-enable it by making the code call
that function with the msg argument in case feedback_fn is callable. The
patch also modifies burnin to accept the new argument format (msg is not...

f1048938 07/14/2008 04:15 pm Iustin Pop

First version of user feedback fixes

This patch contains a raw version for fixing feedback_fn.

The new mechanism works as follows:
- instead of a per-Processor feedback_fn, there's one for each
ExecOpCode, so that feedback for different opcodes go via possibly...

af30b2fd 07/11/2008 01:25 pm Michael Hanselmann

Make "gnt-job list" work again

"gnt-job list" was broken after my recent changes in the RPC
between clients and the master. This patch makes it work again.

Reviewed-by: iustinp

0bbe448c 07/09/2008 01:34 pm Michael Hanselmann

Change masterd/client RPC protocol

- Introduce abstraction class on client side
- Use constants for method names
- Adopt legacy function SubmitOpCode to use it

Reviewed-by: iustinp

2cb687ad 07/03/2008 03:06 pm Iustin Pop

Reuse the luxi client in cli.SubmitOpCode

By a mistake, we don't reuse the luxi client. As such, we open and close
the connection at each poll cycle and spam the server logs.

Reviewed-by: ultrotter

03a8dbdc 06/21/2008 09:49 pm Iustin Pop

Implement handling of luxi errors in cli.py

Currently the generic handling of ganeti errors in cli.py (GenericMain
and FormatError) only handles the core ganeti errors, and not the client
protocol errors (which live in a separate hierarchy).

This patch adds handling of luxi errors too, and also adds another luxi...

2a2060ff 06/13/2008 03:46 pm Michael Hanselmann

Replace logging functions with calls to logging module

- Shorter code
- Reorder arguments to logger.SetupLogging calls to make more sense

Reviewed-by: iustinp

c4dbb30a 06/12/2008 01:06 pm Michael Hanselmann

Remove unreachable code from cli.SubmitOpCode

Reviewed-by: iustinp

4e713df6 05/13/2008 04:41 pm Iustin Pop

CLI: retry: remove command opts/args in "gnt-X"

This new version of the patch removes only the listing of the usage in
the "gnt-X" list, but keeps the strings in since we'll want to enhance
and use them in "gnt-X $cmd --help".

Reviewed-by: ultrotter

9a033156 05/13/2008 04:04 pm Iustin Pop

Revert "CLI: remove command opts/args in "gnt-X""

This reverts commit 976.

Reviewed-by: ultrotter

57d0151e 05/13/2008 03:24 pm Iustin Pop

CLI: remove command opts/args in "gnt-X"

[Forward-port of the 1.2 branch patch]

This patch removes all the parameters and options from the output
"gnt-X" (i.e. the subcommand list for command). This is done in order to
uniformize the output, currently only some parameters are shown and they...

a4af651e 04/28/2008 04:02 pm Iustin Pop

Move the 'cmd' lock from cli.py to ganeti-masterd

This patch removes the lock and the lock options from cli.py and moves
them to the master.

Later during development we can remove it completely, but for now it's
good to protect any other tool that uses the lock directly....

685ee993 04/28/2008 04:01 pm Iustin Pop

Convert cli.SubmitOpCode to use the master

This patch converts the cli.py SubmitOpCode method to use the unix
protocol and thus execute the opcodes via the master.

The patch allows a partial burnin to work with the master. Currently the
query opcodes, since they are executed via the SubmitOpCode, are...

a14a17fc 04/07/2008 02:15 pm Iustin Pop

Move some checks from cli.py to luxi.py

The idea of cli.py and luxi.py is that all protocol checks should be in
luxi, and cli.py should just offer some helpful shortcuts for the
command line scripts.

This patch removes the result checks from cli and adds some other checks...

ceab32dd 04/01/2008 04:05 pm Iustin Pop

Add submit function to lib/cli.py

This patch adds function that submit jobs or queries over the unix socket
interface to lib/cli.py. The will be used by the scripts instead of the
SubmitOpCode function.

Reviewed-by: ultrotter

d8a4b51d 01/28/2008 04:32 pm Iustin Pop

Improve the documentation of query output fields

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...

70a35b6f 01/25/2008 05:36 pm Guido Trotter

Add a missing parenthesis

It was wrongly deleted when converting

if a in dict.keys():
to
if a in dict:

Reviewed-by: imsnah

de47cf8f 01/21/2008 06:28 pm Guido Trotter

Add support for command aliases

Passing a new aliases dict to generic main we can easily support aliases for
compatibility reasons or simply useability.

Reviewed-by: iustinp

36c68ff1 12/12/2007 05:18 pm Iustin Pop

Handle ^C while trying to acquire the lock

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....

f362096f 11/29/2007 06:03 pm Iustin Pop

Make utils.RunCmd log failures when using debug

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

60d49723 11/06/2007 07:04 pm Michael Hanselmann

Remove --secondary-node option.

Replace --secondary-node option with an optional parameter for --node.

e2e521d0 11/05/2007 11:22 pm Iustin Pop

Small cleanup for error formatting

Reviewed-by: ultrotter

65fe4693 11/05/2007 05:06 pm Iustin Pop

Miscellaneous style fixes

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

1a8c0ce1 10/29/2007 10:09 pm Iustin Pop

Change the signature of some methods of mcpu.Processor

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

01ca31ae 10/10/2007 06:06 pm Iustin Pop

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

3023170f 10/10/2007 05:04 pm Iustin Pop

Fix AskUser to not die on extra input

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...

2f31098c 10/10/2007 01:00 pm Iustin Pop

Remove the shebang from modules

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

0c434948 10/09/2007 12:13 pm Iustin Pop

Fix a wrong exception name

This was introduced in rev 208.

Reviewed-by: imsnah

73702ee7 10/09/2007 12:13 pm Iustin Pop

Separate error formatting out of cli.GenericMain

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....

9f33ef86 10/09/2007 10:39 am Iustin Pop

Enhance cli.SubmitOpcode to use custom parameters

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

b9ea6acb 10/08/2007 06:12 pm Iustin Pop

Add handler for errors.TagError

This patch adds a simple handler for TagError that prints the error
(better than having a stack dump).

Reviewed-by: imsnah

810c50b7 10/08/2007 06:12 pm Iustin Pop

Add source file option for {add,remove}-tags

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

846baef9 10/08/2007 06:11 pm Iustin Pop

Implement command-line tags support

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

334d1483 10/08/2007 05:42 pm Iustin Pop

Extend GenericMain with a way to override options

This allows scripts to pass options to generic functions (options that
are not visible in the command line).

Reviewed-by: imsnah

89e1fc26 09/21/2007 04:37 pm Iustin Pop

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 long
as:
- we always resolve the names as returned by socket.gethostname()
- we rely on having a working resolver...

47988778 09/19/2007 05:24 pm Iustin Pop

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:...

16be8703 08/17/2007 12:14 pm Iustin Pop

Change cli.OutputTable to cli.GenerateTable

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

3ecf6786 08/14/2007 06:17 pm Iustin Pop

Style changes for pep-8 and python-3000 compliance.

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...

fe7b0351 07/26/2007 07:09 pm Michael Hanselmann

- Move --force option to cli.py
- Implement “gnt-instance reinstall”
- Fix two typos

Reviewed-by: iustinp

098c0958 07/26/2007 02:40 pm Michael Hanselmann

Comment formatting updates.

Reviewed-by: iustinp

137161c9 07/24/2007 04:29 pm Michael Hanselmann

Use generic function to output tables.

Reviewed-by: iustinp

dcb93971 07/24/2007 02:45 pm Michael Hanselmann

- 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

Reviewed-by: iustinp

a8083063 07/16/2007 04:39 pm Iustin Pop

Initial commit.