tools/run-pep8: remove leading ',' fed to --ignore
--ignore was being called with ',E121,E...' rather than 'E121,E...'. that resulted in odd behavior, missing the pep8 errors that are fixed here.
This commit is contained in:
@@ -119,7 +119,8 @@ class Distro(distros.Distro):
|
|||||||
index = n.group(0)
|
index = n.group(0)
|
||||||
|
|
||||||
(out, err) = util.subp(['ifconfig', '-a'])
|
(out, err) = util.subp(['ifconfig', '-a'])
|
||||||
ifconfigoutput = [x for x in (out.strip()).splitlines() if len(x.split()) > 0]
|
ifconfigoutput = [x for x in (out.strip()).splitlines()
|
||||||
|
if len(x.split()) > 0]
|
||||||
for line in ifconfigoutput:
|
for line in ifconfigoutput:
|
||||||
m = re.match('^\w+', line)
|
m = re.match('^\w+', line)
|
||||||
if m:
|
if m:
|
||||||
|
|||||||
@@ -180,4 +180,3 @@ def translate_network(settings):
|
|||||||
if cmd == 'iface' and 'inet6' in args:
|
if cmd == 'iface' and 'inet6' in args:
|
||||||
real_ifaces[dev_name]['inet6'] = True
|
real_ifaces[dev_name]['inet6'] = True
|
||||||
return real_ifaces
|
return real_ifaces
|
||||||
|
|
||||||
|
|||||||
@@ -79,8 +79,8 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
|
|||||||
else:
|
else:
|
||||||
mtype = None
|
mtype = None
|
||||||
sync = True
|
sync = True
|
||||||
results = util.mount_cb(dev, read_config_drive, mtype=mtype,
|
results = util.mount_cb(dev, read_config_drive,
|
||||||
sync=sync)
|
mtype=mtype, sync=sync)
|
||||||
found = dev
|
found = dev
|
||||||
except openstack.NonReadable:
|
except openstack.NonReadable:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ BUILTIN_DS_CONFIG = {
|
|||||||
MD_RETRIES = 0
|
MD_RETRIES = 0
|
||||||
MD_TIMEOUT = 1
|
MD_TIMEOUT = 1
|
||||||
|
|
||||||
|
|
||||||
class DataSourceDigitalOcean(sources.DataSource):
|
class DataSourceDigitalOcean(sources.DataSource):
|
||||||
def __init__(self, sys_cfg, distro, paths):
|
def __init__(self, sys_cfg, distro, paths):
|
||||||
sources.DataSource.__init__(self, sys_cfg, distro, paths)
|
sources.DataSource.__init__(self, sys_cfg, distro, paths)
|
||||||
@@ -51,8 +52,8 @@ class DataSourceDigitalOcean(sources.DataSource):
|
|||||||
self.timeout = MD_TIMEOUT
|
self.timeout = MD_TIMEOUT
|
||||||
|
|
||||||
def get_data(self):
|
def get_data(self):
|
||||||
caller = functools.partial(util.read_file_or_url, timeout=self.timeout,
|
caller = functools.partial(util.read_file_or_url,
|
||||||
retries=self.retries)
|
timeout=self.timeout, retries=self.retries)
|
||||||
md = ec2_utils.MetadataMaterializer(str(caller(self.metadata_address)),
|
md = ec2_utils.MetadataMaterializer(str(caller(self.metadata_address)),
|
||||||
base_url=self.metadata_address,
|
base_url=self.metadata_address,
|
||||||
caller=caller)
|
caller=caller)
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ DO_META = {
|
|||||||
|
|
||||||
MD_URL_RE = re.compile(r'http://169.254.169.254/metadata/v1/.*')
|
MD_URL_RE = re.compile(r'http://169.254.169.254/metadata/v1/.*')
|
||||||
|
|
||||||
|
|
||||||
def _request_callback(method, uri, headers):
|
def _request_callback(method, uri, headers):
|
||||||
url_path = urlparse(uri).path
|
url_path = urlparse(uri).path
|
||||||
if url_path.startswith('/metadata/v1/'):
|
if url_path.startswith('/metadata/v1/'):
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ GCE_META_PARTIAL = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HEADERS = {'X-Google-Metadata-Request': 'True'}
|
HEADERS = {'X-Google-Metadata-Request': 'True'}
|
||||||
MD_URL_RE = re.compile(r'http://metadata.google.internal./computeMetadata/v1/.*')
|
MD_URL_RE = re.compile(
|
||||||
|
r'http://metadata.google.internal./computeMetadata/v1/.*')
|
||||||
|
|
||||||
|
|
||||||
def _request_callback(method, uri, headers):
|
def _request_callback(method, uri, headers):
|
||||||
|
|||||||
@@ -342,8 +342,8 @@ class TestSmartOSDataSource(helpers.FilesystemMockingTestCase):
|
|||||||
"""
|
"""
|
||||||
User-data in the SmartOS world is supposed to be written to a file
|
User-data in the SmartOS world is supposed to be written to a file
|
||||||
each and every boot. This tests to make sure that in the event the
|
each and every boot. This tests to make sure that in the event the
|
||||||
legacy user-data is removed, the existing user-data is backed-up and
|
legacy user-data is removed, the existing user-data is backed-up
|
||||||
there is no /var/db/user-data left.
|
and there is no /var/db/user-data left.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
user_data_f = "%s/mdata-user-data" % self.legacy_user_d
|
user_data_f = "%s/mdata-user-data" % self.legacy_user_d
|
||||||
|
|||||||
@@ -294,7 +294,6 @@ IPV6_AUTOCONF=no
|
|||||||
self.assertCfgEquals(expected_buf, str(write_buf))
|
self.assertCfgEquals(expected_buf, str(write_buf))
|
||||||
self.assertEquals(write_buf.mode, 0644)
|
self.assertEquals(write_buf.mode, 0644)
|
||||||
|
|
||||||
|
|
||||||
def test_simple_write_freebsd(self):
|
def test_simple_write_freebsd(self):
|
||||||
fbsd_distro = self._get_distro('freebsd')
|
fbsd_distro = self._get_distro('freebsd')
|
||||||
util_mock = self.mocker.replace(util.write_file,
|
util_mock = self.mocker.replace(util.write_file,
|
||||||
@@ -357,4 +356,3 @@ defaultrouter="192.168.1.254"
|
|||||||
'''
|
'''
|
||||||
self.assertCfgEquals(expected_buf, str(write_buf))
|
self.assertCfgEquals(expected_buf, str(write_buf))
|
||||||
self.assertEquals(write_buf.mode, 0644)
|
self.assertEquals(write_buf.mode, 0644)
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class TestConfig(helpers.FilesystemMockingTestCase):
|
|||||||
'epel-testing': {
|
'epel-testing': {
|
||||||
'name': 'Extra Packages for Enterprise Linux 5 - Testing',
|
'name': 'Extra Packages for Enterprise Linux 5 - Testing',
|
||||||
# Missing this should cause the repo not to be written
|
# Missing this should cause the repo not to be written
|
||||||
# 'baseurl': 'http://blah.org/pub/epel/testing/5/$basearch',
|
# 'baseurl': 'http://blah.org/pub/epel/testing/5/$barch',
|
||||||
'enabled': False,
|
'enabled': False,
|
||||||
'gpgcheck': True,
|
'gpgcheck': True,
|
||||||
'gpgkey': 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
|
'gpgkey': 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ $a,$b'''
|
|||||||
mirror = "mymirror"
|
mirror = "mymirror"
|
||||||
codename = "zany"
|
codename = "zany"
|
||||||
in_data = "deb $mirror $codename-updates main contrib non-free"
|
in_data = "deb $mirror $codename-updates main contrib non-free"
|
||||||
ex_data = "deb %s %s-updates main contrib non-free" % (mirror, codename)
|
ex_data = "deb %s %s-updates main contrib non-free" % (mirror,
|
||||||
|
codename)
|
||||||
|
|
||||||
out_data = templater.basic_render(in_data,
|
out_data = templater.basic_render(in_data,
|
||||||
{'mirror': mirror, 'codename': codename})
|
{'mirror': mirror, 'codename': codename})
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ IGNORE="$IGNORE,E126" # Continuation line over-indented for hanging indent
|
|||||||
IGNORE="$IGNORE,E127" # Continuation line over-indented for visual indent
|
IGNORE="$IGNORE,E127" # Continuation line over-indented for visual indent
|
||||||
IGNORE="$IGNORE,E128" # Continuation line under-indented for visual indent
|
IGNORE="$IGNORE,E128" # Continuation line under-indented for visual indent
|
||||||
IGNORE="$IGNORE,E502" # The backslash is redundant between brackets
|
IGNORE="$IGNORE,E502" # The backslash is redundant between brackets
|
||||||
|
IGNORE="${IGNORE#,}" # remove the leading ',' added above
|
||||||
|
|
||||||
cmd=(
|
cmd=(
|
||||||
${base}/hacking.py
|
${base}/hacking.py
|
||||||
|
|||||||
Reference in New Issue
Block a user