def main():
<EOL>arg_parser = argparse.ArgumentParser()<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store_true>', default=False,  help='<STR_LIT>')<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store_true>', default=False,  help='<STR_LIT>')<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', required=True, action='<STR_LIT:store>', help='<STR_LIT:Name>')<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', required=True, action='<STR_LIT:store>',<EOL>help='<STR_LIT>')<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', required=True, action='<STR_LIT:store>',<EOL>help='<STR_LIT>')<EOL>arg_parser.add_argument('<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store_true>', default=False,<EOL>help='<STR_LIT>')<EOL>args = arg_parser.parse_args()<EOL>name = args.name<EOL>rgname = args.rgname<EOL>location = args.location<EOL>if args.add is True and args.delete is True:<EOL><INDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>if args.add is False and args.delete is False: <EOL><INDENT>sys.exit('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in os.environ and '<STR_LIT>' in os.environ:<EOL><INDENT>endpoint = os.environ['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>sys.exit('<STR_LIT>') <EOL><DEDENT>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>access_token = azurerm.get_access_token_from_cli()<EOL>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>subscription_id = azurerm.get_subscription_from_cli()<EOL>if  args.add is True: <EOL><INDENT>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>tenants = azurerm.list_tenants(access_token)<EOL>tenant_id = tenants['<STR_LIT:value>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>' + tenant_id)<EOL><DEDENT>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT>object_id = azurerm.get_object_id_from_graph()<EOL>if args.verbose is True:<EOL><INDENT>print('<STR_LIT>' + object_id)<EOL><DEDENT>ret = azurerm.create_keyvault(access_token, subscription_id, rgname, name, location, tenant_id=tenant_id, object_id=object_id)<EOL>if ret.status_code == <NUM_LIT:200>:<EOL><INDENT>print('<STR_LIT>' + name)<EOL>print('<STR_LIT>' + ret.json()['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>' + str(ret.status_code) + '<STR_LIT>')<EOL>print(ret.text)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ret = azurerm.delete_keyvault(access_token, subscription_id, rgname, name)<EOL>if ret.status_code == <NUM_LIT:200>:<EOL><INDENT>print('<STR_LIT>' + name)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>' + str(ret.status_code) + '<STR_LIT>')<EOL>print(ret.text)<EOL><DEDENT><DEDENT>
Main routine.