Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.utils.text_unittest.py @ ebfb2f46

History | View | Annotate | Download (21.2 kB)

# Date Author Comment
6a9b9778 10/05/2012 04:52 am Michael Hanselmann

utils.FilterEmptyLinesAndComments: Return list

We don't use generators often and lists are easier to re-use.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

1be3e86c 10/04/2012 06:00 pm Michael Hanselmann

Add unit test for FilterEmptyLinesAndComments

I somehow forgot this in the previous patch.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

4af458e3 09/19/2012 04:54 pm Michael Hanselmann

ShellWriter: Add parameter to disable indentation

This will be used to write a more compact bash completion script.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

26a72a48 03/30/2012 03:02 pm Michael Hanselmann

Merge cli.FormatTimestamp and utils.FormatTime

… to some degree at least. Unittests are included.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5401c39d 02/17/2012 05:39 pm Michael Hanselmann

utils.text: Add function to truncate string

The function adds an ellipse if the string was actually truncated. Also
start using it in mcpu for result checks (where the message is also
slightly changed to use a colon).

Signed-off-by: Michael Hanselmann <>...

59d81cb3 01/19/2012 03:14 pm Michael Hanselmann

Merge branch 'devel-2.5'

  • devel-2.5:
    Fix wrong option names in QA and cluster-merge
    Bump version to 2.5.0~rc5, update NEWS
    Add UnescapeAndSplit unittest for multi-escapes
    Fix a bug in command line option parsing code
    cli: Disable abbreviation matching for options...
e7f7212b 01/19/2012 02:42 pm Iustin Pop

Add UnescapeAndSplit unittest for multi-escapes

This would have caught the bug in the first place. Argh,
hand-generated test cases!

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

dce20078 10/24/2011 03:49 pm Michael Hanselmann

utils.ShellWriter: Don't indent empty lines

Empty lines shouldn't get indented. Unittest included.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

72ce3463 08/26/2011 05:53 pm René Nussbaumer

Merge branch 'devel-2.4' into devel-2.5

Conflicts:
NEWS (trivial)
configure.ac (trivial)
daemons/ensure-dirs.in (deleted)

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

e4a48c7b 08/26/2011 03:53 pm Michael Hanselmann

utils: Fix UnescapeAndSplit parsing bug

If a value passed to UnescapeAndSplit ended with a backslash an
exception would be raised:

$ gnt-instance modify -H mem=x\\ inst1.example.com
[…]
e2 = slist.pop(0)
IndexError: pop from empty list

Signed-off-by: Michael Hanselmann <>...

bbfed756 04/06/2011 02:05 pm Michael Hanselmann

utils: Add function generating regex for DNS name globbing

The intent of this function is to be able to provide a globbing operator
or query filters. One should be able to say, for example, something to
the effect of “gnt-instance shutdown '*.site'”.

Also rename a variable in MatchNameComponent....

92ea69bf 02/24/2011 03:25 pm Michael Hanselmann

Add function to format ordinals

See [1] for the rules.

[1] http://en.wikipedia.org/wiki/Names_of_numbers_in_English#Ordinal_numbers

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

7ebd876f 01/11/2011 05:33 pm Michael Hanselmann

utils: Move more text-related code

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7fcffe27 01/10/2011 06:15 pm Michael Hanselmann

utils: Move text-related functions into separate file

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>