[openstack-dev] [trove]The patch from 191859 breaks the compatibility with python 2.6

陈迪豪 chendihao at unitedstack.com
Mon Jul 6 10:16:48 UTC 2015

Hi all,

We're deploying trove with python 2.6 in production. And the latest code from https://review.openstack.org/#/c/191859 has broken the compatible with python 2.6.

The actual code which causes it is in trove/guestagent/common/operating_system.py and looks like thest. Python 2.6 has syntax error for this "list" expression.

def list_files_in_directory(root_dir, recursive=False, pattern=None):
    return {os.path.abspath(os.path.join(root, name))
            for (root, _, files) in os.walk(root_dir, topdown=True)
            if recursive or (root == root_dir)
            for name in files
            if not pattern or re.match(pattern, name)}

It would be great for anyone to fix it for both python 2.6 and 2.7, right?

- tobe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150706/b75b3152/attachment.html>

More information about the OpenStack-dev mailing list