summaryrefslogtreecommitdiff
path: root/cloudinit/transforms/cc_disable_ec2_metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/transforms/cc_disable_ec2_metadata.py')
-rw-r--r--cloudinit/transforms/cc_disable_ec2_metadata.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/transforms/cc_disable_ec2_metadata.py b/cloudinit/transforms/cc_disable_ec2_metadata.py
index 4d2a7f55..3c0dd57b 100644
--- a/cloudinit/transforms/cc_disable_ec2_metadata.py
+++ b/cloudinit/transforms/cc_disable_ec2_metadata.py
@@ -28,5 +28,6 @@ reject_cmd = ['route', 'add', '-host', '169.254.169.254', 'reject']
def handle(_name, cfg, _cloud, _log, _args):
- if util.get_cfg_option_bool(cfg, "disable_ec2_metadata", False):
+ disabled = util.get_cfg_option_bool(cfg, "disable_ec2_metadata", False)
+ if disabled:
util.subp(reject_cmd)