summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorZee314159 <252806294@qq.com>2019-11-27 04:47:12 +0100
committerZee314159 <252806294@qq.com>2019-11-27 11:27:29 +0100
commitbd3e0f2a1d9793aebc6a57d143c67919600ae71c (patch)
treedafd15447a2573fb1ad0a73d0866d553eb2c8055 /classes
parent88c3bcc7f56c1404ebec2da03c7290c9b00336a7 (diff)
downloadmeta-updater-bd3e0f2a1d9793aebc6a57d143c67919600ae71c.tar.gz
keep new name suggestion remove ostree repo checkfeat/ota-3202/Add-sanity-checks-for-SOTA-variables-in-meta-updater
Signed-off-by: Zee314159 <252806294@qq.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/sota_sanity.bbclass10
1 files changed, 7 insertions, 3 deletions
diff --git a/classes/sota_sanity.bbclass b/classes/sota_sanity.bbclass
index 3678e33..1339fb3 100644
--- a/classes/sota_sanity.bbclass
+++ b/classes/sota_sanity.bbclass
@@ -27,12 +27,16 @@ def sota_check_variables_validity(status, d):
27 prov = d.getVar("SOTA_CLIENT_PROV").strip() 27 prov = d.getVar("SOTA_CLIENT_PROV").strip()
28 if prov not in ("aktualizr-shared-prov", "aktualizr-device-prov", "aktualizr-device-prov-hsm", ""): 28 if prov not in ("aktualizr-shared-prov", "aktualizr-device-prov", "aktualizr-device-prov-hsm", ""):
29 status.addresult("Valid options for SOTA_CLIENT_PROV are aktualizr-shared-prov, aktualizr-device-prov and aktualizr-device-prov-hsm.\n") 29 status.addresult("Valid options for SOTA_CLIENT_PROV are aktualizr-shared-prov, aktualizr-device-prov and aktualizr-device-prov-hsm.\n")
30 if prov == "aktualizr-auto-prov":
31 bb.warn('aktualizr-auto-prov is deprecated. Please use aktualizr-shared-prov instead.')
32 elif prov == "aktualizr-ca-implicit-prov":
33 bb.warn('aktualizr-ca-implicit-prov is deprecated. Please use aktualizr-device-prov instead.')
34 elif prov == "aktualizr-hsm-prov":
35 bb.warn('aktualizr-hsm-prov is deprecated. Please use aktualizr-device-prov-hsm instead.')
30 if d.getVar("GARAGE_TARGET_URL") and re.match("^(https?|ftp|file)://.+$", d.getVar("GARAGE_TARGET_URL")) is None: 36 if d.getVar("GARAGE_TARGET_URL") and re.match("^(https?|ftp|file)://.+$", d.getVar("GARAGE_TARGET_URL")) is None:
31 status.addresult("GARAGE_TARGET_URL is set to a bad url.\n") 37 status.addresult("GARAGE_TARGET_URL is set to a bad url.\n")
32 if d.getVar("SOTA_POLLING_SEC") and re.match("^(0|\+?[1-9][0-9]*)$", d.getVar("SOTA_POLLING_SEC")) is None: 38 if d.getVar("SOTA_POLLING_SEC") and re.match("^[1-9]\d*|0$", d.getVar("SOTA_POLLING_SEC")) is None:
33 status.addresult("SOTA_POLLING_SEC should be an integer.\n") 39 status.addresult("SOTA_POLLING_SEC should be an integer.\n")
34 if d.getVar("OSTREE_REPO") and re.match("^\/([a-zA-Z0-9_-]+\/?)+$", d.getVar("OSTREE_REPO")) is None:
35 status.addresult("OSTREE_REPO is not set correctly. Path to your OSTree repository is invalid.\n")
36 config = d.getVar("SOTA_SECONDARY_CONFIG") 40 config = d.getVar("SOTA_SECONDARY_CONFIG")
37 if config is not None and config != "": 41 if config is not None and config != "":
38 path = os.path.abspath(config) 42 path = os.path.abspath(config)