mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-16 11:58:09 +00:00
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:
@ -277,7 +277,16 @@ class Deployer:
|
|||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
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 = argparse.ArgumentParser()
|
||||||
parser.add_argument("--instance", default=default_instance)
|
parser.add_argument("--instance", default=default_instance)
|
||||||
group = parser.add_mutually_exclusive_group()
|
group = parser.add_mutually_exclusive_group()
|
||||||
|
Reference in New Issue
Block a user