diff options
author | Shih-Yuan Lee (FourDollars) <sylee@canonical.com> | 2017-10-23 10:49:31 +0800 |
---|---|---|
committer | Shih-Yuan Lee (FourDollars) <sylee@canonical.com> | 2017-10-23 10:49:31 +0800 |
commit | 189179da14af222900ea01700700f86792c3bbda (patch) | |
tree | 2033be95b8bf298e0158b1638a1d473c016173e7 | |
parent | c9b075a3fc0772609e4d1a30d0ff3bf37d1a1e87 (diff) |
Fix bto_version for new bto.xml design.
-rwxr-xr-x | bin/recovery_info | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/recovery_info b/bin/recovery_info index 4aa03cb..b2feedb 100755 --- a/bin/recovery_info +++ b/bin/recovery_info @@ -246,7 +246,15 @@ class RecoveryVersion(Command): fname = "{}/bto.xml".format(mntdir) if os.path.isfile(fname): o = minidom.parse("{}/bto.xml".format(mntdir)) - bto_version = o.getElementsByTagName("iso")[0].firstChild.data + bto_platform = o.getElementsByTagName("platform") + bto_revision = o.getElementsByTagName("revision") + if bto_platform and bto_revision: + bto_platform = bto_platform[0].firstChild.data + bto_revision = bto_revision[0].firstChild.data + bto_version = bto_platform + " " + bto_revision + else: + bto_iso = o.getElementsByTagName("iso") + bto_version = bto_iso[0].firstChild.data print("bto_version: {}".format(bto_version)) |