Fix filter() usage due to python 3 compability

Built-in method filter() returns a list in Python 2.x [1], but it
returns an iterator in Python 3.x [2]. To remove the difference (and
make code more readable, also), we use list comprehension instead of filer().

[1] http://docs.python.org/2/library/functions.html#filter
[2] http://docs.python.org/3/library/functions.html#filter

Related to blueprint make-python3-compatible

Change-Id: Ifd42403309ba3a44693e0c7c856a64b861eca3e9
Fix database connection string is secret

The database connection string was not marked as secret, so it
would be printed out in cleartext in the logs when config settings
were logged.

The database connection string typically contains the password
that's used to connect to the database, so it should be marked as
secret so that it doesn't get logged.

Change-Id: If6e1026814262c961a4f22d90f546cec34831bc8
Closes-Bug: #1266590
Merge "Fix database connection string is secret"
Merge "Fix filter() usage due to python 3 compability"