Browse Source

Remove grenade jobs from old stable branches

As discussed and approved during the ironic wallaby midcycle, the grenade
jobs in old stable branches.
And remove lower-constraints job.

Also replace subprocess with processutils to fix the dsvm-python3 job.

Change-Id: Ibdfed9545a26e752ab7aeed2db122a368c3c06fb
(cherry picked from commit 1ef55e3603)
changes/06/787506/1
Kaifeng Wang 3 years ago
committed by Riccardo Pittau
parent
commit
fa5f7fe7bf
  1. 24
      ironic_inspector/pxe_filter/iptables.py
  2. 6
      ironic_inspector/test/unit/test_iptables.py
  3. 4
      zuul.d/project.yaml

24
ironic_inspector/pxe_filter/iptables.py

@ -15,7 +15,7 @@ import contextlib
import os
import re
from eventlet.green import subprocess
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log
@ -68,10 +68,9 @@ class IptablesFilter(pxe_filter.BaseFilter):
# -w flag makes iptables wait for xtables lock, but it's not supported
# everywhere yet
try:
with open(os.devnull, 'wb') as null:
subprocess.check_call(self.base_command + ('-w', '-h'),
stderr=null, stdout=null)
except subprocess.CalledProcessError:
cmd = self.base_command + ('-w', '-h')
processutils.execute(*cmd)
except processutils.ProcessExecutionError:
LOG.warning('iptables does not support -w flag, please update '
'it to at least version 1.4.21')
else:
@ -151,18 +150,15 @@ class IptablesFilter(pxe_filter.BaseFilter):
cmd = self.base_command + args
ignore = kwargs.pop('ignore', False)
LOG.debug('Running iptables %s', args)
kwargs['stderr'] = subprocess.STDOUT
try:
subprocess.check_output(cmd, **kwargs)
except subprocess.CalledProcessError as exc:
decoded_output = exc.output.decode("utf-8")
output = decoded_output.replace('\n', '. ')
processutils.execute(*cmd)
except processutils.ProcessExecutionError as exc:
if ignore:
LOG.debug('Ignoring failed iptables %(args)s: %(output)s',
{'args': args, 'output': output})
LOG.debug('Ignoring failed iptables %(args)s: %(error)s',
{'args': args, 'error': exc})
else:
LOG.error('iptables %(iptables)s failed: %(exc)s',
{'iptables': args, 'exc': output})
LOG.error('iptables %(iptables)s failed: %(error)s',
{'iptables': args, 'error': exc})
raise
def _clean_up(self, chain):

6
ironic_inspector/test/unit/test_iptables.py

@ -37,7 +37,7 @@ class TestIptablesDriver(test_base.NodeTest):
self.mock_fsm = self.useFixture(
fixtures.MockPatchObject(iptables.IptablesFilter, 'fsm')).mock
self.mock_call = self.useFixture(
fixtures.MockPatchObject(iptables.subprocess, 'check_call')).mock
fixtures.MockPatchObject(iptables.processutils, 'execute')).mock
self.driver = iptables.IptablesFilter()
self.mock_iptables = self.useFixture(
fixtures.MockPatchObject(self.driver, '_iptables')).mock
@ -73,8 +73,8 @@ class TestIptablesDriver(test_base.NodeTest):
self.check_fsm([pxe_filter.Events.initialize])
def test_init_args_old_iptables(self):
self.mock_call.side_effect = iptables.subprocess.CalledProcessError(
2, '')
exc = iptables.processutils.ProcessExecutionError(2, '')
self.mock_call.side_effect = exc
self.driver.init_filter()
init_expected_args = [
('-D', 'INPUT', '-i', 'br-ctlplane', '-p', 'udp', '--dport', '67',

4
zuul.d/project.yaml

@ -7,22 +7,18 @@
- release-notes-jobs
check:
jobs:
- ironic-inspector-grenade-dsvm
- ironic-inspector-tempest-dsvm-discovery
- ironic-inspector-tempest-dsvm-python3
- openstack-tox-functional
- openstack-tox-functional-py35
- ironic-tempest-dsvm-ironic-inspector
- openstack-tox-lower-constraints
- openstack-tox-cover
gate:
queue: ironic
jobs:
- ironic-inspector-grenade-dsvm
- ironic-inspector-tempest-dsvm-discovery
- ironic-inspector-tempest-dsvm-python3
- openstack-tox-functional
- openstack-tox-functional-py35
- ironic-tempest-dsvm-ironic-inspector
- openstack-tox-lower-constraints
- openstack-tox-cover

Loading…
Cancel
Save