Add a username to the resource group name created by check-pr utility. (#1314)

* Add a username to the resource group name created by check-pr utility.

* Use check_output
This commit is contained in:
Marc Greisen
2021-10-06 08:00:55 -07:00
committed by GitHub
parent e721dc0351
commit 58eea1e51a

View File

@ -277,7 +277,16 @@ class Deployer:
def main() -> None:
default_instance = "pr-check-%s" % uuid.uuid4().hex
# Get a name that can be added to the resource group name
# to make it easy to identify the owner
cmd = ["az", "ad", "signed-in-user", "show", "--query", "mailNickname", "-o", "tsv"]
name = subprocess.check_output(cmd, encoding="UTF-8")
# The result from az includes a newline
# which we strip out.
name = name.strip()
default_instance = f"pr-check-{name}-%s" % uuid.uuid4().hex
parser = argparse.ArgumentParser()
parser.add_argument("--instance", default=default_instance)
group = parser.add_mutually_exclusive_group()