From 9b178c065325a4a86c0d38d4c3b328a8142cb64e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 15 Dec 2021 13:26:32 -0500 Subject: [PATCH] Provide nicer error message on existing name Packing ontop of an existing profile is not presently supported, provide a clearer indication of this. --- imgutil/imgutil | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgutil/imgutil b/imgutil/imgutil index 3fa31213..ee06ad1b 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -1104,6 +1104,9 @@ def pack_image(args): raise Exception('Full path not supported, supply only the profile name') privdir = os.path.join('/var/lib/confluent/private/os/', outdir) outdir = os.path.join('/var/lib/confluent/public/os/', outdir) + if os.path.exists(outdir): + sys.stderr.write('Profile already exists, select a different name or delete existing {0}\n'.format(outdir)) + sys.exit(1) imginfofile = os.path.join(args.scratchdir, 'etc/confluentimg.buildinfo') distpath = None try: