summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_apt_configure.py2
-rw-r--r--cloudinit/config/cc_growpart.py2
-rw-r--r--cloudinit/config/cc_rh_subscription.py8
3 files changed, 6 insertions, 6 deletions
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index 2c51d116..9e9e9e26 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -109,7 +109,7 @@ def handle(name, cfg, cloud, log, _args):
# get gpg keyid from keyserver
def getkeybyid(keyid, keyserver):
- with util.ExtendedTemporaryFile(suffix='.sh') as fh:
+ with util.ExtendedTemporaryFile(suffix='.sh', mode="w+", ) as fh:
fh.write(EXPORT_GPG_KEYID)
fh.flush()
cmd = ['/bin/sh', fh.name, keyid, keyserver]
diff --git a/cloudinit/config/cc_growpart.py b/cloudinit/config/cc_growpart.py
index f52c41f0..859d69f1 100644
--- a/cloudinit/config/cc_growpart.py
+++ b/cloudinit/config/cc_growpart.py
@@ -276,7 +276,7 @@ def handle(_name, cfg, _cloud, log, _args):
log.debug("use ignore_growroot_disabled to ignore")
return
- devices = util.get_cfg_option_list(cfg, "devices", ["/"])
+ devices = util.get_cfg_option_list(mycfg, "devices", ["/"])
if not len(devices):
log.debug("growpart: empty device list")
return
diff --git a/cloudinit/config/cc_rh_subscription.py b/cloudinit/config/cc_rh_subscription.py
index cabebca4..6da26d25 100644
--- a/cloudinit/config/cc_rh_subscription.py
+++ b/cloudinit/config/cc_rh_subscription.py
@@ -384,9 +384,9 @@ class SubscriptionManager(object):
"because it is not enabled".format(fail))
cmd = ['repos']
- if enable_list > 0:
+ if len(enable_list) > 0:
cmd.extend(enable_list)
- if disable_list > 0:
+ if len(disable_list) > 0:
cmd.extend(disable_list)
try:
@@ -395,10 +395,10 @@ class SubscriptionManager(object):
self.log_warn("Unable to alter repos due to {0}".format(e))
return False
- if enable_list > 0:
+ if len(enable_list) > 0:
self.log.debug("Enabled the following repos: %s" %
(", ".join(enable_list)).replace('--enable=', ''))
- if disable_list > 0:
+ if len(disable_list) > 0:
self.log.debug("Disabled the following repos: %s" %
(", ".join(disable_list)).replace('--disable=', ''))
return True