From c0d1a59d96a16c080ad8b8278251294cccc21894 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Tue, 10 Sep 2013 18:35:19 +0200 Subject: Fix detection of ETHx_IP context variable, add test. --- cloudinit/sources/DataSourceOpenNebula.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cloudinit/sources') diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py index 1b419cfd..141bd454 100644 --- a/cloudinit/sources/DataSourceOpenNebula.py +++ b/cloudinit/sources/DataSourceOpenNebula.py @@ -376,7 +376,6 @@ def read_context_disk_dir(source_dir, asuser=None): # to shell parser non_empty = re.match(r'.*?^\s*([^# ]+)', content, re.MULTILINE | re.DOTALL) - if non_empty: context = parse_shell_config(content, asuser=asuser) except IOError as e: @@ -420,7 +419,7 @@ def read_context_disk_dir(source_dir, asuser=None): # only if there are any required context variables # http://opennebula.org/documentation:rel3.8:cong#network_configuration for k in context.keys(): - if re.match(r'^ETH\d+_ip$', k): + if re.match(r'^ETH\d+_IP$', k): (out, _) = util.subp(['/sbin/ip', 'link']) net = OpenNebulaNetwork(out, context) results['network-interfaces'] = net.gen_conf() -- cgit v1.2.3