-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/datacenter/acitoolkit
- Loading branch information
Showing
5 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Simple application that takes a tenant json from a file and returns a tenant object | ||
""" | ||
import acitoolkit.acitoolkit as ACI | ||
import argparse | ||
import json | ||
|
||
|
||
def main(): | ||
""" | ||
Main execution routine | ||
""" | ||
description = 'Simple application that takes a tenant json from a configfile and returns a tenant object.' | ||
parser = argparse.ArgumentParser(description=description) | ||
parser.add_argument('-t', '--tenantname', required = True, help='name of the tenant') | ||
parser.add_argument('-config','--tenantconfigfile', required=True, | ||
help='file containing tenant json') | ||
args = parser.parse_args() | ||
|
||
tenantObject = None | ||
if args.tenantconfigfile: | ||
with open(args.tenantconfigfile) as data_file: | ||
tenant_json = json.load(data_file) | ||
|
||
tenant = ACI.Tenant(args.tenantname) | ||
ACI.Tenant.get_from_json(tenant,tenant_json,parent=tenant) | ||
print(tenant.get_json()) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters