Fix instack-undercloud PEP8 failures and requirements constraints

PEP8 have new changes that make invalid escapes a hard failure.
Also, it's failing on the requirements check.

Also the build-openstack-releasenotes job taker the setup info
from master, as we do not have master anymore we can not run the
build-openstack-releasenotes job.

This submission fixes:
- Unit tests failing with scaping incorrectly backslashes.
- Lower constraints.
- Requirements.
- Test requirements.

Closes-Bug: 1805583
Change-Id: I3a620ca13eaf7ca0e8d1e560ffeb30d25f4d82c5
This commit is contained in:
Carlos Camacho 2018-11-22 03:30:41 -05:00
parent 15cda5ada3
commit 0b9002106a
6 changed files with 16 additions and 14 deletions

View File

@ -271,8 +271,9 @@ class TestCheckHostname(BaseTestCase):
undercloud._check_hostname()
mock_run_command.assert_called_with([
'sudo', '/bin/bash', '-c',
'sed -i "s/127.0.0.1\(\s*\)/127.0.0.1\\1test.hostname test /" '
'/etc/hosts'],
r'sed -i "s/127.0.0.1\(\s*\)/'
r'127.0.0.1\\1test.hostname test /"'
' /etc/hosts'],
name='hostname-to-etc-hosts')
@mock.patch('instack_undercloud.undercloud._run_command')
@ -288,8 +289,9 @@ class TestCheckHostname(BaseTestCase):
undercloud._check_hostname()
mock_run_command.assert_called_with([
'sudo', '/bin/bash', '-c',
'sed -i "s/127.0.0.1\(\s*\)/127.0.0.1\\1test.hostname test /" '
'/etc/hosts'],
r'sed -i "s/127.0.0.1\(\s*\)/'
r'127.0.0.1\\1test.hostname test /"'
' /etc/hosts'],
name='hostname-to-etc-hosts')
@mock.patch('instack_undercloud.undercloud._run_command')
@ -305,8 +307,8 @@ class TestCheckHostname(BaseTestCase):
undercloud._check_hostname()
mock_run_command.assert_called_with([
'sudo', '/bin/bash', '-c',
'sed -i "s/127.0.0.1\(\s*\)/'
'127.0.0.1\\1test-hostname.domain test-hostname /" '
r'sed -i "s/127.0.0.1\(\s*\)/'
r'127.0.0.1\\1test-hostname.domain test-hostname /" '
'/etc/hosts'],
name='hostname-to-etc-hosts')

View File

@ -692,8 +692,8 @@ def _check_hostname():
if short_hostname == detected_static_hostname:
raise RuntimeError('Configured hostname is not fully '
'qualified.')
sed_cmd = ('sed -i "s/127.0.0.1\(\s*\)/127.0.0.1\\1%s %s /" '
'/etc/hosts' %
sed_cmd = (r'sed -i "s/127.0.0.1\(\s*\)/127.0.0.1\\1%s %s /"'
' /etc/hosts' %
(detected_static_hostname, short_hostname))
args = ['sudo', '/bin/bash', '-c', sed_cmd]
_run_command(args, name='hostname-to-etc-hosts')

View File

@ -24,7 +24,7 @@ jmespath==0.9.0
jsonpatch==1.16
jsonpointer==1.13
jsonschema==2.6.0
keystoneauth1==3.4.0
keystoneauth1==3.8.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
@ -36,7 +36,7 @@ munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
openstackdocstheme==1.18.1
openstacksdk==0.11.2
openstacksdk==0.17.2
os-apply-config==5.0.0
os-client-config==1.28.0
os-refresh-config==6.0.0
@ -57,7 +57,7 @@ Pygments==2.2.0
pyparsing==2.1.0
pyperclip==1.5.27
pystache==0.5.4
python-ironicclient==2.2.0
python-ironicclient==2.3.0
python-keystoneclient==3.8.0
python-mimeparse==1.6.0
python-mistralclient==3.1.0
@ -73,7 +73,7 @@ rfc3986==0.3.1
simplejson==3.5.1
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.6.5
Sphinx==1.7.6
sphinxcontrib-websupport==1.0.1
stevedore==1.20.0
testrepository==0.0.18

View File

@ -16,3 +16,4 @@ pystache>=0.5.4 # MIT
os-refresh-config>=6.0.0 # Apache-2.0
os-apply-config>=5.0.0 # Apache-2.0
os-client-config>=1.28.0 # Apache-2.0
openstacksdk>=0.17.2

View File

@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later.
# Doc requirements
openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinx!=1.6.6,!=1.6.7,>=1.7.6 # BSD
hacking<0.11,>=0.10.0

View File

@ -3,7 +3,6 @@
- openstack-python-jobs
- openstack-python35-jobs
- check-requirements
- release-notes-jobs
check:
jobs:
- openstack-tox-lower-constraints