diff options
author | Tomás Touceda <chiiph@torproject.org> | 2011-09-02 20:44:53 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@torproject.org> | 2011-09-02 20:44:53 -0300 |
commit | f04c3429dc33c9bcadfe8a3707f8646690838db8 (patch) | |
tree | 101a178256e71c5aba0d960c00181298be61f464 /lib/thandy/formats.py | |
parent | 40b3a86a82054c88f5865cef9b8d7fff8486f768 (diff) |
Fix behavior for bundles with more than one thp and add thp
Diffstat (limited to 'lib/thandy/formats.py')
-rwxr-xr-x | lib/thandy/formats.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/thandy/formats.py b/lib/thandy/formats.py index f57ab46..0a73ff4 100755 --- a/lib/thandy/formats.py +++ b/lib/thandy/formats.py @@ -746,6 +746,7 @@ def makePackageObj(config_fname, package_fname): 'exe_registry_ent', 'db_key', 'db_val', 'command_install', 'command_remove', + 'thp_name', 'thp_version', ], preload) f = open(package_fname, 'rb') @@ -783,8 +784,12 @@ def makePackageObj(config_fname, package_fname): elif format == 'thp': extra['check_type'] = 'thp' extra['install_type'] = 'thp' - extra['thp_name'] = r['name'] - extra['thp_version'] = r['version'] + if not r.get('thp_name'): + raise thandy.FormatException("missing thp_name value") + extra['thp_name'] = r['thp_name'] + if not r.get('thp_version'): + raise thandy.FormatException("missing thp_version value") + extra['thp_version'] = r['thp_version'] if r.get('command_install'): extra['install_type'] = 'command' |