diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-03-22 11:48:15 +0000 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-03-22 11:48:15 +0000 |
commit | 720d18901a3c8d1f2e32fded42db1e7b8132e16a (patch) | |
tree | 5424fa41f9d918f12b5de82ccaf250ee16c2bc52 /prepare-config.py | |
parent | b19bf7ab77d555e2c467950ce2a56a8b6324f4f5 (diff) |
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 <milosz.wasilewski@linaro.org>
Diffstat (limited to 'prepare-config.py')
-rwxr-xr-x | prepare-config.py | 5 |
1 files 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<device_id>[a-zA-Z0-9_\-]+):(?P<key>[a-zA-Z0-9_\-]+)=(?P<value>.*)$") + lava_cache_regexp = re.compile("^(?P<device_id>[a-zA-Z0-9_\-]+):(?P<key>[a-zA-Z0-9_\-\.]+)=(?P<value>.*)$") 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()) |