← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:pylint/1444-pylint-tip-ignore-e1101-from-contextlib into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:pylint/1444-pylint-tip-ignore-e1101-from-contextlib into cloud-init:master.

Commit message:
pylint: make tox -e pylint-tip pass by ignoring a misreported error.

This just silences a warning in pylint.  The issue is reported upstream
at https://github.com/PyCQA/pylint/issues/1444 .

Requested reviews:
  Joshua Powers (powersj)
  Chad Smith (chad.smith)
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1691489 in cloud-init: "fstab entries written by cloud-config may not be mounted"
  https://bugs.launchpad.net/cloud-init/+bug/1691489

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/324401
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:pylint/1444-pylint-tip-ignore-e1101-from-contextlib into cloud-init:master.
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 67ff7ba..135e460 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -478,10 +478,11 @@ def decomp_gzip(data, quiet=True, decode=True):
     try:
         buf = six.BytesIO(encode_text(data))
         with contextlib.closing(gzip.GzipFile(None, "rb", 1, buf)) as gh:
+            # E1101 is https://github.com/PyCQA/pylint/issues/1444
             if decode:
-                return decode_binary(gh.read())
+                return decode_binary(gh.read())  # pylint: disable=E1101
             else:
-                return gh.read()
+                return gh.read()  # pylint: disable=E1101
     except Exception as e:
         if quiet:
             return data
diff --git a/setup.py b/setup.py
index 4616599..a61c24a 100755
--- a/setup.py
+++ b/setup.py
@@ -65,6 +65,7 @@ INITSYS_FILES = {
     'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)],
     'systemd': [f for f in (glob('systemd/*.service') +
                             glob('systemd/*.target')) if is_f(f)],
+    'systemd.fsck-dropin': ['systemd/systemd-fsck@.service.d/cloud-init.conf'],
     'systemd.generators': [f for f in glob('systemd/*-generator') if is_f(f)],
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
 }
@@ -76,6 +77,9 @@ INITSYS_ROOTS = {
     'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'),
     'systemd.generators': pkg_config_read('systemd',
                                           'systemdsystemgeneratordir'),
+    'systemd.fsck-dropin': (
+        os.path.sep.join([pkg_config_read('systemd', 'systemdsystemunitdir'),
+                          'systemd-fsck@.service.d'])),
     'upstart': '/etc/init/',
 }
 INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
diff --git a/systemd/systemd-fsck@.service.d/cloud-init.conf b/systemd/systemd-fsck@.service.d/cloud-init.conf
new file mode 100644
index 0000000..0bfa465
--- /dev/null
+++ b/systemd/systemd-fsck@.service.d/cloud-init.conf
@@ -0,0 +1,2 @@
+[Unit]
+After=cloud-init.service

References