From 720d18901a3c8d1f2e32fded42db1e7b8132e16a Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 22 Mar 2016 11:48:15 +0000 Subject: prepare-config.py: signal prefix can contain . now When . character was included in the signal prefix, regular expression didn't match it in the tmp file and target device address (USB or IP) wasn't passed properly. This is now fixed and if the address is missing, the prepare-config.py will exit(1) failing the host part instantly. Change-Id: Ibed1660ec9ac83a21b30e30b74adefa4797c0076 Signed-off-by: Milosz Wasilewski --- prepare-config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/prepare-config.py b/prepare-config.py index 3678ee4..94f81f0 100755 --- a/prepare-config.py +++ b/prepare-config.py @@ -54,7 +54,7 @@ if __name__ == '__main__': parser.error("Prefix missing") lava_cache_file = open(LAVA_CACHE_PATH, 'r') - lava_cache_regexp = re.compile("^(?P[a-zA-Z0-9_\-]+):(?P[a-zA-Z0-9_\-]+)=(?P.*)$") + lava_cache_regexp = re.compile("^(?P[a-zA-Z0-9_\-]+):(?P[a-zA-Z0-9_\-\.]+)=(?P.*)$") ipaddr = None for line in lava_cache_file.readlines(): print line @@ -68,7 +68,8 @@ if __name__ == '__main__': with open(IPADDR_FILE, "w") as ipaddr_file: ipaddr_file.write(ipaddr) lava_cache_file.close() - if not ipaddr: + if ipaddr is None: + print "Target device address not found or _MISSING_" sys.exit(1) config = open(os.path.join(CONFIG_PATH, options.config), "r") config_template = Template(config.read()) -- cgit v1.2.3