To give some, hopefully, marginally more readable Python.
Signed-off-by: Brian Foley
---
lib/cmdlib/cluster/__init__.py | 6 --
lib/cmdlib/cluster/verify.py | 25 -
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git
This version traverses the results twice but is probably faster
because it generates fewer temporary results.
Signed-off-by: Brian Foley
---
lib/client/gnt_cluster.py | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/lib/client/gnt_cluster.py
The replacement code is slightly longer, but much more pythonic.
Signed-off-by: Brian Foley
---
lib/watcher/__init__.py | 34 --
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/lib/watcher/__init__.py b/lib/watcher/__init__.py
map(lambda x: expr(x), seq)
can be written more simply as
[expr(x) for x in seq]
Signal that we need the side effects of expr by replacing
map(lambda x: UpdateState(x, ...), seq)
with
for x in seq:
UpdateState(x, ...)
Signed-off-by: Brian Foley
---
In particular, avoid the use of operator, partial and map when they read more
like directly translated Haskell code than idiomatic python.
This patchset should have no significant functional changes. If it does, I got
something wrong.
Brian Foley (6):
Replace map(operator.attrgetter, ...)
The rather Haskellish pattern
map(compat.partial(fn, arg), xs)
can be replaced by the much more pythonic
[fn(arg, x) for x in xs]
Signed-off-by: Brian Foley
---
lib/cmdlib/common.py | 11 +++
lib/cmdlib/instance_query.py | 14 ++
map(operator.attrgetter("foo"), bar)
can be replaced by the equivalent, shorter, and much more pythonic
[b.foo for b in bar]
Signed-off-by: Brian Foley
---
lib/cmdlib/cluster/verify.py | 5 ++---
qa/qa_instance_utils.py | 5 +
Let the user know that the issues can be fixed using
gnt-cluster renew-crypto --new-node-certificates
Signed-off-by: Brian Foley
---
lib/cmdlib/cluster/verify.py | 92 ++
test/py/cmdlib/cluster_unittest.py | 38 +---
2
On Fri, Aug 12, 2016 at 03:03:18PM +0100, Ganeti Development List wrote:
> Luckily, nothing that changes the meaning anywhere.
>
> Signed-off-by: Brian Foley
LGTM, thanks.
Luckily, nothing that changes the meaning anywhere.
Signed-off-by: Brian Foley
---
man/gnt-cluster.rst | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/man/gnt-cluster.rst b/man/gnt-cluster.rst
index 2ba3a31..5c055ee 100644
---
On 12 August 2016 at 15:38, Brian Foley wrote:
> On Fri, Aug 12, 2016 at 03:13:53PM +0200, Iustin Pop wrote:
> >On 12 August 2016 at 15:04, 'Brian Foley' via ganeti-devel
> ><[1]ganeti-devel@googlegroups.com> wrote:
> >
> > This makes it a little easier to
On Fri, Aug 12, 2016 at 03:13:53PM +0200, Iustin Pop wrote:
>On 12 August 2016 at 15:04, 'Brian Foley' via ganeti-devel
><[1]ganeti-devel@googlegroups.com> wrote:
>
> This makes it a little easier to eyeball the output of make
> py-tests.
>
>Ooh, nice, this is a very old
On 12 August 2016 at 15:04, 'Brian Foley' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:
> This makes it a little easier to eyeball the output of make py-tests.
>
Ooh, nice, this is a very old bug, thanks!
+logger = logging.getLogger('pyinotify')
> +logger.propagate = False
>
This makes it a little easier to eyeball the output of make py-tests.
Signed-off-by: Brian Foley
---
test/py/ganeti.asyncnotifier_unittest.py | 4
1 file changed, 4 insertions(+)
diff --git a/test/py/ganeti.asyncnotifier_unittest.py
LGTM, thanks!
On Friday, August 12, 2016 at 1:09:24 PM UTC+1, Brian Foley wrote:
>
> This suppresses the interactive 'are you sure' check to allows instance
> renaming without DNS checks to be scripted.
>
> Signed-off-by: Brian Foley
> ---
> lib/client/gnt_instance.py |
This suppresses the interactive 'are you sure' check to allows instance
renaming without DNS checks to be scripted.
Signed-off-by: Brian Foley
---
lib/client/gnt_instance.py | 11 ++-
man/gnt-instance.rst | 6 +-
2 files changed, 11 insertions(+), 6
16 matches
Mail list logo