Break out py27 job templates

To allow non-py27 supporting repos to use shade job templates, this
breaks out the py27 and py3 jobs into separate templates. Relevant repos
can then continue to use the existing template names without picking up
the unsupported job runtimes they no longer need.

Change-Id: Ia211e31723ede592f19a8df6c18e45699ca25788
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-07 06:26:01 -05:00 committed by Monty Taylor
parent e7c7f29ae9
commit 439ecbb9b0
9 changed files with 52 additions and 19 deletions

View File

@ -11,7 +11,9 @@
required-projects:
- openstack/shade
- openstack/keystoneauth
- openstack/openstacksdk
# stable/train is needed for py27 support
- name: openstack/openstacksdk
override-checkout: stable/train
- openstack/os-client-config
- job:
@ -31,14 +33,21 @@
- openstack/os-client-config
- project-template:
name: shade-tox-tips
name: shade-tox-tips-py27
check:
jobs:
- shade-tox-py27-tips
- shade-tox-py35-tips
gate:
jobs:
- shade-tox-py27-tips
- project-template:
name: shade-tox-tips
check:
jobs:
- shade-tox-py35-tips
gate:
jobs:
- shade-tox-py35-tips
- job:
@ -113,6 +122,7 @@
description: |
Run shade functional tests against a master devstack
vars:
python_version: 2.7
devstack_localrc:
Q_SERVICE_PLUGIN_CLASSES: qos
Q_ML2_PLUGIN_EXT_DRIVERS: qos,port_security
@ -137,15 +147,21 @@
- name: openstack/openstacksdk
- name: openstack/os-client-config
vars:
python_version: 2.7
tox_install_siblings: true
- job:
name: shade-functional-devstack-tips-python3
parent: shade-functional-devstack-tips
parent: shade-functional-devstack
description: |
Run shade functional tests with tips of library dependencies using
python3 against a master devstack.
required-projects:
- name: openstack/keystoneauth
- name: openstack/openstacksdk
- name: openstack/os-client-config
vars:
tox_install_siblings: true
tox_environment:
SHADE_TOX_PYTHON: python3
@ -204,14 +220,21 @@
tox_install_siblings: true
- project-template:
name: shade-functional-tips
name: shade-functional-tips-py27
check:
jobs:
- shade-functional-devstack-tips
- shade-functional-devstack-tips-python3
gate:
jobs:
- shade-functional-devstack-tips
- project-template:
name: shade-functional-tips
check:
jobs:
- shade-functional-devstack-tips-python3
gate:
jobs:
- shade-functional-devstack-tips-python3
- project:
@ -224,7 +247,9 @@
- publish-to-pypi
- release-notes-jobs-python3
- shade-functional-tips
- shade-functional-tips-py27
- shade-tox-tips
- shade-tox-tips-py27
check:
jobs:
- bifrost-integration-tinyipa:

View File

@ -28,6 +28,8 @@ def _construct_yaml_str(self, node):
# Override the default string handling function
# to always return unicode objects
return self.construct_scalar(node)
yaml_loader.add_constructor(u'tag:yaml.org,2002:str', _construct_yaml_str)
# Unquoted dates like 2013-05-23 in yaml files get loaded as objects of type
# datetime.data which causes problems in API layer when being processed by

View File

@ -619,7 +619,7 @@ def parse_range(value):
if value is None:
return None
range_exp = re.match('(<|>|<=|>=){0,1}(\d+)$', value)
range_exp = re.match(r'(<|>|<=|>=){0,1}(\d+)$', value)
if range_exp is None:
return None

View File

@ -84,6 +84,7 @@ class OpenStackCloudBadRequest(OpenStackCloudHTTPError):
class OpenStackCloudURINotFound(OpenStackCloudHTTPError):
pass
# Backwards compat
OpenStackCloudResourceNotFound = OpenStackCloudURINotFound

View File

@ -395,10 +395,10 @@ def _get_supplemental_addresses(cloud, server):
server['status'] == 'ACTIVE'):
for port in cloud.search_ports(
filters=dict(device_id=server['id'])):
# This SHOULD return one and only one FIP - but doing
# it as a search/list lets the logic work regardless
for fip in cloud.search_floating_ips(
filters=dict(port_id=port['id'])):
# This SHOULD return one and only one FIP - but doing
# it as a search/list lets the logic work regardless
if fip['fixed_ip_address'] not in fixed_ip_mapping:
log = _log.setup_logging('shade')
log.debug(

View File

@ -3152,10 +3152,10 @@ class OpenStackCloud(
return ""
def _get_server_console_output(self, server_id, length=None):
data = self._compute_client.post(
'/servers/{server_id}/action'.format(server_id=server_id),
json={'os-getConsoleOutput': {'length': length}})
return self._get_and_munchify('output', data)
data = self._compute_client.post(
'/servers/{server_id}/action'.format(server_id=server_id),
json={'os-getConsoleOutput': {'length': length}})
return self._get_and_munchify('output', data)
def get_server(
self, name_or_id=None, filters=None, detailed=False, bare=False,
@ -9305,7 +9305,7 @@ class OpenStackCloud(
"before setting provide state"):
machine = self.get_machine(machine['uuid'])
if (machine['reservation'] is None and
machine['provision_state'] is not 'enroll'):
machine['provision_state'] != 'enroll'):
# NOTE(TheJulia): In this case, the node has
# has moved on from the previous state and is
# likely not being verified, as no lock is

View File

@ -33,7 +33,7 @@ ORCHESTRATION_ENDPOINT = 'https://orchestration.example.com/v1/{p}'.format(
p=PROJECT_ID)
NO_MD5 = '93b885adfe0da089cdf634904fd59f71'
NO_SHA256 = '6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d'
FAKE_PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkF3MX59OrlBs3dH5CU7lNmvpbrgZxSpyGjlnE8Flkirnc/Up22lpjznoxqeoTAwTW034k7Dz6aYIrZGmQwe2TkE084yqvlj45Dkyoj95fW/sZacm0cZNuL69EObEGHdprfGJQajrpz22NQoCD8TFB8Wv+8om9NH9Le6s+WPe98WC77KLw8qgfQsbIey+JawPWl4O67ZdL5xrypuRjfIPWjgy/VH85IXg/Z/GONZ2nxHgSShMkwqSFECAC5L3PHB+0+/12M/iikdatFSVGjpuHvkLOs3oe7m6HlOfluSJ85BzLWBbvva93qkGmLg4ZAc8rPh2O+YIsBUHNLLMM/oQp Generated-by-Nova\n" # flake8: noqa
FAKE_PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkF3MX59OrlBs3dH5CU7lNmvpbrgZxSpyGjlnE8Flkirnc/Up22lpjznoxqeoTAwTW034k7Dz6aYIrZGmQwe2TkE084yqvlj45Dkyoj95fW/sZacm0cZNuL69EObEGHdprfGJQajrpz22NQoCD8TFB8Wv+8om9NH9Le6s+WPe98WC77KLw8qgfQsbIey+JawPWl4O67ZdL5xrypuRjfIPWjgy/VH85IXg/Z/GONZ2nxHgSShMkwqSFECAC5L3PHB+0+/12M/iikdatFSVGjpuHvkLOs3oe7m6HlOfluSJ85BzLWBbvva93qkGmLg4ZAc8rPh2O+YIsBUHNLLMM/oQp Generated-by-Nova\n" # noqa
def make_fake_flavor(flavor_id, name, ram=100, disk=1600, vcpus=24):
@ -58,6 +58,8 @@ def make_fake_flavor(flavor_id, name, ram=100, disk=1600, vcpus=24):
u'swap': u'',
u'vcpus': vcpus
}
FAKE_FLAVOR = make_fake_flavor(FLAVOR_ID, 'vanilla')
FAKE_CHOCOLATE_FLAVOR = make_fake_flavor(
CHOCOLATE_FLAVOR_ID, 'chocolate', ram=200)
@ -248,11 +250,12 @@ def make_fake_machine(machine_name, machine_id=None):
id=machine_id,
name=machine_name))
def make_fake_port(address, node_id=None, port_id=None):
if not node_id:
node_id = uuid.uuid4().hex
node_id = uuid.uuid4().hex
if not port_id:
port_id = uuid.uuid4().hex
port_id = uuid.uuid4().hex
return meta.obj_to_munch(FakeMachinePort(
id=port_id,
address=address,
@ -377,6 +380,7 @@ class FakeMachinePort(object):
self.address = address
self.node_uuid = node_id
def make_fake_neutron_security_group(
id, name, description, rules, project_id=None):
if not rules:

View File

@ -75,6 +75,7 @@ class FakeCloud(object):
def get_default_network(self):
return None
standard_fake_server = fakes.make_fake_server(
server_id='test-id-0',
name='test-id-0',

View File

@ -32,7 +32,7 @@ skip_install = True
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
doc8
hacking
hacking>=2.0,<3
pygments
commands =
doc8 doc/source
@ -97,7 +97,7 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
# H4 Are about docstrings - and there's just too many of them to fix
# W503 Is supposed to be off by default but a bug has it on by default. It's
# also a categorially terrible idea and Donald Knuth agrees with me.
ignore = H103,H306,H4,W503
ignore = H103,H306,H4,W503,W504
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build