alphagov/estools — pull request #5 by samjsharpe (2013-08-31 12:16:20+00:00)
Title: Fix parameters to optimize call

es.optimize takes named parameters, not whatever this thing was... /cc @tombooth

```
$ /usr/local/bin/es-rotate --delete-old --delete-maxage 21 --optimize-old --optimize-maxage 1 logs
Traceback (most recent call last):
File "/usr/local/bin/es-rotate", line 9, in
load_entry_point('estools==1.1.0', 'console_scripts', 'es-rotate')()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1948, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python2.6/dist-packages/estools/command/rotate.py", line 72
self.es.optimize([name], { "max_num_segments", 1 })
^
SyntaxError: invalid syntax
```

https://github.com/aparo/pyes/blob/c14bcfe4f4156d2c49274e309aab1e80c09356af/pyes/managers.py#L307-L312