summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_bootcmd.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_bootcmd.py')
-rw-r--r--cloudinit/config/cc_bootcmd.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/cloudinit/config/cc_bootcmd.py b/cloudinit/config/cc_bootcmd.py
index 48cd21cc..45012c3a 100644
--- a/cloudinit/config/cc_bootcmd.py
+++ b/cloudinit/config/cc_bootcmd.py
@@ -9,8 +9,8 @@
"""Bootcmd: run arbitrary commands early in the boot process."""
+import logging
import os
-from logging import Logger
from textwrap import dedent
from cloudinit import subp, temp_utils, util
@@ -19,6 +19,8 @@ from cloudinit.config import Config
from cloudinit.config.schema import MetaSchema, get_meta_doc
from cloudinit.settings import PER_ALWAYS
+LOG = logging.getLogger(__name__)
+
frequency = PER_ALWAYS
distros = ["all"]
@@ -63,12 +65,10 @@ meta: MetaSchema = {
__doc__ = get_meta_doc(meta)
-def handle(
- name: str, cfg: Config, cloud: Cloud, log: Logger, args: list
-) -> None:
+def handle(name: str, cfg: Config, cloud: Cloud, args: list) -> None:
if "bootcmd" not in cfg:
- log.debug(
+ LOG.debug(
"Skipping module named %s, no 'bootcmd' key in configuration", name
)
return
@@ -79,7 +79,7 @@ def handle(
tmpf.write(util.encode_text(content))
tmpf.flush()
except Exception as e:
- util.logexc(log, "Failed to shellify bootcmd: %s", str(e))
+ util.logexc(LOG, "Failed to shellify bootcmd: %s", str(e))
raise
try:
@@ -90,7 +90,7 @@ def handle(
cmd = ["/bin/sh", tmpf.name]
subp.subp(cmd, env=env, capture=False)
except Exception:
- util.logexc(log, "Failed to run bootcmd module %s", name)
+ util.logexc(LOG, "Failed to run bootcmd module %s", name)
raise