buildextend-openstack: Default to latest build
Just automatically use latest build if none specified since this command
will most likely be used after `build` in the same script.
@@ -13,10 +13,17 @@ from cmdlib import run_verbose, write_json, sha256sum_file
# Parse args and dispatch
parser = argparse.ArgumentParser()
-parser.add_argument("--build", help="Build ID",
- required=True)
+parser.add_argument("--build", help="Build ID")
args = parser.parse_args()
+# default to latest build if not specified
+if not args.build:
+ with open('builds/builds.json') as f:
+ j = json.load(f)
+ args.build = j['builds'][0]
+
+print(f"Targeting build: {args.build}")
+
with open('src/config/manifest.yaml') as f:
manifest = yaml.safe_load(f)
