Skip to content

Commit

Permalink
If no masterfiles path is given to cf-remote deploy and no cfbs, then…
Browse files Browse the repository at this point in the history
… use .

Ticket: ENT-11158
Changelog: title
  • Loading branch information
craigcomstock committed Jan 10, 2024
1 parent 8090dc5 commit 10b1e8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cf_remote/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down

0 comments on commit 10b1e8a

Please sign in to comment.