blob: 90dc400e0c88cfb8ffc32e3bad1ee2c6b40b5b29 [file] [log] [blame]
#!/usr/bin/env python3
import sys
sys.path.append('lib')
import argparse
from charms.layer import options
parser = argparse.ArgumentParser(description='Access layer options.')
parser.add_argument('section',
help='the section, or layer, the option is from')
parser.add_argument('option',
help='the option to access')
args = parser.parse_args()
value = options(args.section).get(args.option, '')
if isinstance(value, bool):
sys.exit(0 if value else 1)
elif isinstance(value, list):
for val in value:
print(val)
else:
print(value)