Detect globbing patterns as query arguments
authorMichael Hanselmann <hansmi@google.com>
Mon, 8 Aug 2011 15:31:59 +0000 (17:31 +0200)
committerMichael Hanselmann <hansmi@google.com>
Mon, 8 Aug 2011 15:42:49 +0000 (17:42 +0200)
commitf8638e288c7a5a74966d2452c97825826edc7b50
tree6b27dd0e09e441399ca01ccbfcc3a1981509a4ef
parent1fcd3b81456ba1bd1a10cd6e60f2f5e51d06bf53
Detect globbing patterns as query arguments

Short: this patch enables the use of “gnt-instance list '*.site'”.

Detailed description: This patch changes the command line interface code
to try to deduce the kind of filter from the arguments to a “list”
command. If it's a list of plain names an old-style name filter is used.
If filtering is forced or the single argument is potentially a filter,
it is parsed as a query filter string. Any name looking like a globbing
pattern (e.g. “*.site” or “web?.example.com”) is treated as such.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/cli.py
lib/qlang.py
test/ganeti.qlang_unittest.py