From c61d1f80ca8cdc9319a3d49f775db618fa1d7971 Mon Sep 17 00:00:00 2001 From: indorilftw Date: Wed, 12 Nov 2014 16:43:14 +0200 Subject: [PATCH] Fix pythonic expressions in snf-pithos-backend directory --- snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py | 6 +++--- snf-pithos-backend/pithos/backends/migrate.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py index d8e9d0fb4..ffdde7273 100644 --- a/snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py +++ b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/public.py @@ -100,7 +100,7 @@ def public_unset_bulk(self, paths): def public_get(self, path): s = select([self.public.c.url]) s = s.where(and_(self.public.c.path == path, - self.public.c.active == True)) + self.public.c.active is True)) r = self.conn.execute(s) row = r.fetchone() r.close() @@ -112,7 +112,7 @@ def public_list(self, prefix): s = select([self.public.c.path, self.public.c.url]) s = s.where(self.public.c.path.like( self.escape_like(prefix) + '%', escape=ESCAPE_CHAR)) - s = s.where(self.public.c.active == True) + s = s.where(self.public.c.active is True) r = self.conn.execute(s) rows = r.fetchall() r.close() @@ -121,7 +121,7 @@ def public_list(self, prefix): def public_path(self, public): s = select([self.public.c.path]) s = s.where(and_(self.public.c.url == public, - self.public.c.active == True)) + self.public.c.active is True)) r = self.conn.execute(s) row = r.fetchone() r.close() diff --git a/snf-pithos-backend/pithos/backends/migrate.py b/snf-pithos-backend/pithos/backends/migrate.py index e61c80126..5b4d17e16 100644 --- a/snf-pithos-backend/pithos/backends/migrate.py +++ b/snf-pithos-backend/pithos/backends/migrate.py @@ -90,7 +90,7 @@ def main(argv=None, **kwargs): exit(1) # default config arg, if not already set - if not '-c' in argv: + if '-c' not in argv: argv.insert(0, DEFAULT_ALEMBIC_INI_PATH) argv.insert(0, '-c')