summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-12-30 20:24:49 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-19 03:43:27 +0200
commit0bd4bb66745d06a508e52db4c790334aee17f596 (patch)
tree45cec109d390a4a9c395d5d59235ceab902dfca2 /bin
parent23b0544436270031406723dd53a4337f4232bd20 (diff)
error out if the path to the updater config is empty
Change-Id: Ic199b15222836e096e32203d3458487fead6e3e1
Diffstat (limited to 'bin')
-rw-r--r--bin/update/config.py25
-rwxr-xr-xbin/update/create_full_mar.py4
2 files changed, 29 insertions, 0 deletions
diff --git a/bin/update/config.py b/bin/update/config.py
new file mode 100644
index 000000000000..2af895bb2921
--- /dev/null
+++ b/bin/update/config.py
@@ -0,0 +1,25 @@
+
+import configparser
+
+class Config(object):
+
+ def __init__(self):
+ self.certificate_path = None
+ self.certificate_name = None
+ self.channel = None
+ self.base_url = None
+ self.upload_url = None
+
+def parse_config(config_file):
+ config = configparser.ConfigParser()
+ config.read(config_file)
+
+ data = Config()
+ updater_data = config['Updater']
+ data.base_url = updater_data['base-url']
+ data.certificate_name = updater_data['certificate-name']
+ data.certificate_path = updater_data['certificate-path']
+ data.channel = updater_data['channel']
+ data.upload_url = updater_data['upload-url']
+
+ return data
diff --git a/bin/update/create_full_mar.py b/bin/update/create_full_mar.py
index 2362f2c9850d..e657e124971d 100755
--- a/bin/update/create_full_mar.py
+++ b/bin/update/create_full_mar.py
@@ -27,6 +27,10 @@ def main():
workdir = sys.argv[2]
product_name = sys.argv[1]
+ if len(update_config) == 0:
+ print("missing update config")
+ sys.exit(1)
+
config = parse_config(update_config)
tar_dir = os.path.join(workdir, "installation", product_name, "archive", "install", "en-US")