diff --git a/lower-constraints.txt b/lower-constraints.txt index 737f009cfe..6441ba199d 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -3,7 +3,7 @@ alembic==0.9.8 amqp==2.2.2 appdirs==1.4.3 asn1crypto==0.24.0 -astroid==1.3.8 +astroid==1.6.5 # LGPLv2.1 Babel==2.3.4 bandit==1.1.0 beautifulsoup4==4.6.0 @@ -107,7 +107,7 @@ pycparser==2.18 pyflakes==1.0.0 Pygments==2.2.0 pyinotify==0.9.6 -pylint==1.4.5 +pylint==1.9.2 # GPLv2 pymongo==3.0.2 PyMySQL==0.7.6 pyOpenSSL==17.5.0 diff --git a/test-requirements.txt b/test-requirements.txt index 32403d077d..5c5f643d22 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -25,5 +25,5 @@ cassandra-driver!=3.6.0,>=2.1.4 # Apache-2.0 couchdb>=0.8 # Apache-2.0 stestr>=1.1.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 -astroid<1.4.0 # LGPLv2.1 # breaks pylint 1.4.4 -pylint==1.4.5 # GPLv2 +astroid==1.6.5 # LGPLv2.1 +pylint==1.9.2 # GPLv2 diff --git a/tools/trove-pylint.README b/tools/trove-pylint.README index b7811b108d..afbf629e3d 100644 --- a/tools/trove-pylint.README +++ b/tools/trove-pylint.README @@ -161,10 +161,7 @@ and astroid. In testing, I've found that if the version of either of these changes, you could either have a failure of the tool (exceptions thrown, ...) or a different set of errors reported. -Currently, test-requirements.txt sets these versions in this way. - -astroid<1.4.0 # LGPLv2.1 # breaks pylint 1.4.4 -pylint==1.4.5 # GPLv2 +Refer to test-requirements.txt to see the versions currently being used. If you run the tool on your machine and find that there are no errors, but find that either the CI generates errors, or that the tool run diff --git a/tools/trove-pylint.config b/tools/trove-pylint.config index cacdadefca..1682191fdd 100644 --- a/tools/trove-pylint.config +++ b/tools/trove-pylint.config @@ -7,7 +7,7 @@ "Undefined variable '_LW'" ], "folder": "trove", - "ignored_codes": [], + "ignored_codes": ["not-callable"], "ignored_file_code_messages": [ [ "trove/backup/models.py", diff --git a/trove/common/stream_codecs.py b/trove/common/stream_codecs.py index a85d6c68c1..5edf4870d3 100644 --- a/trove/common/stream_codecs.py +++ b/trove/common/stream_codecs.py @@ -207,10 +207,7 @@ class IniCodec(StreamCodec): def deserialize(self, stream): parser = self._init_config_parser() - if sys.version_info >= (3, 2): - parser.read_file(self._pre_parse(stream)) - else: - parser.readfp(self._pre_parse(stream)) + parser.readfp(self._pre_parse(stream)) return {s: {k: StringConverter({None: self._default_value}).to_objects(v) diff --git a/trove/db/sqlalchemy/session.py b/trove/db/sqlalchemy/session.py index 2253f8a5f0..39a0f218e0 100644 --- a/trove/db/sqlalchemy/session.py +++ b/trove/db/sqlalchemy/session.py @@ -132,10 +132,10 @@ def clean_db(): meta.bind = engine meta.reflect() with contextlib.closing(engine.connect()) as con: - trans = con.begin() + trans = con.begin() # pylint: disable=E1101 for table in reversed(meta.sorted_tables): if table.name != "migrate_version": - con.execute(table.delete()) + con.execute(table.delete()) # pylint: disable=E1101 trans.commit() diff --git a/trove/guestagent/datastore/experimental/postgresql/service.py b/trove/guestagent/datastore/experimental/postgresql/service.py index 6c8959ee87..a2017c4b2f 100644 --- a/trove/guestagent/datastore/experimental/postgresql/service.py +++ b/trove/guestagent/datastore/experimental/postgresql/service.py @@ -838,10 +838,10 @@ class PgSqlAdmin(object): :type user: PostgreSQLUser """ # Postgresql requires that you revoke grants before dropping the user - dbs = self.list_access(context, user.name, None) - for d in dbs: - db = models.PostgreSQLSchema.deserialize(d) - self.revoke_access(context, user.name, None, db.name) + databases = list(self.list_access(context, user.name, None)) + for db in databases: + db_schema = models.PostgreSQLSchema.deserialize(db) + self.revoke_access(context, user.name, None, db_schema.name) LOG.info( "{guest_id}: Dropping user {name}.".format( diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py index 7ffebac301..87b14d5c26 100755 --- a/trove/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -1363,6 +1363,8 @@ class BuiltInstanceTasks(BuiltInstance, NotifyMixin, ConfigurationMixin): volume = self.volume_client.volumes.get(self.volume_id) volume_device = self._fix_device_path( volume.attachments[0]['device']) + if volume: + upgrade_info['device'] = volume_device # BUG(1650518): Cleanup in the Pike release some instances # that we will be upgrading will be pre secureserialier @@ -1394,13 +1396,10 @@ class BuiltInstanceTasks(BuiltInstance, NotifyMixin, ConfigurationMixin): sleep_time=2, time_out=600) if not self.server_status_matches(['ACTIVE']): raise TroveError(_("Instance %(instance)s failed to " - "upgrade to %(datastore_version)s"), + "upgrade to %(datastore_version)s") % {'instance': self, 'datastore_version': datastore_version}) - if volume: - upgrade_info['device'] = volume_device - self.guest.post_upgrade(upgrade_info) self.reset_task_status()