From 10b1e8aa89130156ff6a249cefcb6e6d2c21a4cd Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Fri, 5 Jan 2024 10:32:21 -0600 Subject: [PATCH] If no masterfiles path is given to cf-remote deploy and no cfbs, then use . Ticket: ENT-11158 Changelog: title --- cf_remote/commands.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cf_remote/commands.py b/cf_remote/commands.py index d15825c..2fceb1d 100644 --- a/cf_remote/commands.py +++ b/cf_remote/commands.py @@ -800,14 +800,20 @@ def deploy(hubs, masterfiles): ): masterfiles = "out/masterfiles.tgz" print("Found cfbs policy set: '{}'".format(masterfiles)) - elif masterfiles.startswith(("http://", "https://")): + elif masterfiles and masterfiles.startswith(("http://", "https://")): urls = [masterfiles] paths = _download_urls(urls) assert len(paths) == 1 masterfiles = paths[0] log.debug("Deploying downloaded: %s" % masterfiles) else: + if not masterfiles: + masterfiles = "." + if not (os.path.isfile("promises.cf") or os.path.isfile("promises.cf.in")): + user_error("No cfbs or masterfiles policy set found") + masterfiles = os.path.abspath(os.path.expanduser(masterfiles)) + print("Found masterfiles policy set: '{}'".format(masterfiles)) log.debug("Deploy path expanded to: %s" % masterfiles) masterfiles = masterfiles.rstrip("/")