Merge "More Python 3 porting: filter and map, one import"
This commit is contained in:
commit
d1107c9653
@ -1,7 +1,7 @@
|
|||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- openstack-tox-py35:
|
- python-tempestconf-tox-py35:
|
||||||
voting: false
|
voting: false
|
||||||
- python-tempestconf-tox-cover
|
- python-tempestconf-tox-cover
|
||||||
- python-tempestconf-tempest-devstack-admin
|
- python-tempestconf-tempest-devstack-admin
|
||||||
@ -17,6 +17,11 @@
|
|||||||
- python-tempestconf-tempest-packstack-demo
|
- python-tempestconf-tempest-packstack-demo
|
||||||
- tripleo-ci-centos-7-containers-multinode
|
- tripleo-ci-centos-7-containers-multinode
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: python-tempestconf-tox-py35
|
||||||
|
parent: openstack-tox-py35
|
||||||
|
description: Temporary local job which runs unit tests with py35
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: python-tempestconf-tox-cover
|
name: python-tempestconf-tox-cover
|
||||||
parent: openstack-tox
|
parent: openstack-tox
|
||||||
|
@ -91,7 +91,7 @@ class VersionedService(Service):
|
|||||||
for version in body['versions']:
|
for version in body['versions']:
|
||||||
if version['status'] != "DEPRECATED":
|
if version['status'] != "DEPRECATED":
|
||||||
versions.append(version)
|
versions.append(version)
|
||||||
return map(lambda x: x['id'], versions)
|
return list(map(lambda x: x['id'], versions))
|
||||||
|
|
||||||
def no_port_cut_url(self):
|
def no_port_cut_url(self):
|
||||||
# if there is no port defined, cut the url from version to the end
|
# if there is no port defined, cut the url from version to the end
|
||||||
|
@ -25,7 +25,7 @@ class ComputeService(VersionedService):
|
|||||||
def set_extensions(self):
|
def set_extensions(self):
|
||||||
body = self.do_get(self.service_url + '/extensions')
|
body = self.do_get(self.service_url + '/extensions')
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
self.extensions = map(lambda x: x['alias'], body['extensions'])
|
self.extensions = list(map(lambda x: x['alias'], body['extensions']))
|
||||||
|
|
||||||
def set_versions(self):
|
def set_versions(self):
|
||||||
url, top_level = self.no_port_cut_url()
|
url, top_level = self.no_port_cut_url()
|
||||||
|
@ -40,7 +40,7 @@ class IdentityService(VersionedService):
|
|||||||
body = self.do_get(self.service_url + '/extensions')
|
body = self.do_get(self.service_url + '/extensions')
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
values = body['extensions']['values']
|
values = body['extensions']['values']
|
||||||
self.extensions = map(lambda x: x['alias'], values)
|
self.extensions = list(map(lambda x: x['alias'], values))
|
||||||
return
|
return
|
||||||
# Keystone api changed in v3, the concept of extensions changed. Right
|
# Keystone api changed in v3, the concept of extensions changed. Right
|
||||||
# now, all the existing extensions are part of keystone core api, so,
|
# now, all the existing extensions are part of keystone core api, so,
|
||||||
|
@ -124,8 +124,8 @@ class ImageService(VersionedService):
|
|||||||
return self.client.show_image(image_id)
|
return self.client.show_image(image_id)
|
||||||
except exceptions.NotFound:
|
except exceptions.NotFound:
|
||||||
pass
|
pass
|
||||||
found = filter(lambda x: x['name'] == image_name,
|
found = [x for x in self.client.list_images()['images']
|
||||||
self.client.list_images()['images'])
|
if x['name'] == image_name]
|
||||||
if found:
|
if found:
|
||||||
return found[0]
|
return found[0]
|
||||||
else:
|
else:
|
||||||
|
@ -23,7 +23,7 @@ class NetworkService(VersionedService):
|
|||||||
def set_extensions(self):
|
def set_extensions(self):
|
||||||
body = self.do_get(self.service_url + '/v2.0/extensions.json')
|
body = self.do_get(self.service_url + '/v2.0/extensions.json')
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
self.extensions = map(lambda x: x['alias'], body['extensions'])
|
self.extensions = list(map(lambda x: x['alias'], body['extensions']))
|
||||||
|
|
||||||
def create_tempest_networks(self, has_neutron, conf, network_id):
|
def create_tempest_networks(self, has_neutron, conf, network_id):
|
||||||
LOG.info("Setting up network")
|
LOG.info("Setting up network")
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from base import VersionedService
|
from config_tempest.services.base import VersionedService
|
||||||
|
|
||||||
|
|
||||||
class LoadBalancerService(VersionedService):
|
class LoadBalancerService(VersionedService):
|
||||||
|
@ -25,7 +25,7 @@ class VolumeService(VersionedService):
|
|||||||
def set_extensions(self):
|
def set_extensions(self):
|
||||||
body = self.do_get(self.service_url + '/extensions')
|
body = self.do_get(self.service_url + '/extensions')
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
self.extensions = map(lambda x: x['alias'], body['extensions'])
|
self.extensions = list(map(lambda x: x['alias'], body['extensions']))
|
||||||
|
|
||||||
def set_versions(self):
|
def set_versions(self):
|
||||||
url, top_level = self.no_port_cut_url()
|
url, top_level = self.no_port_cut_url()
|
||||||
|
Loading…
Reference in New Issue
Block a user