Fixes is_admin type from StrOpt to BoolOpt.
oslo.config already has a proper type to deal with boolean options. Change-Id: I675c1dbfa13ca68506042f7907082b0e3d51672a Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
This commit is contained in:
parent
48f963b29e
commit
3180feed53
@ -95,13 +95,13 @@ def main():
|
|||||||
conf.register_cli_opt(cfg.StrOpt(
|
conf.register_cli_opt(cfg.StrOpt(
|
||||||
'policy',
|
'policy',
|
||||||
required=True,
|
required=True,
|
||||||
help='path to a policy file'))
|
help='path to a policy file.'))
|
||||||
|
|
||||||
conf.register_cli_opt(cfg.StrOpt(
|
conf.register_cli_opt(cfg.StrOpt(
|
||||||
'access',
|
'access',
|
||||||
required=True,
|
required=True,
|
||||||
help='path to a file containing OpenStack Identity API '
|
help='path to a file containing OpenStack Identity API '
|
||||||
'access info in JSON format'))
|
'access info in JSON format.'))
|
||||||
|
|
||||||
conf.register_cli_opt(cfg.StrOpt(
|
conf.register_cli_opt(cfg.StrOpt(
|
||||||
'target',
|
'target',
|
||||||
@ -110,18 +110,16 @@ def main():
|
|||||||
|
|
||||||
conf.register_cli_opt(cfg.StrOpt(
|
conf.register_cli_opt(cfg.StrOpt(
|
||||||
'rule',
|
'rule',
|
||||||
help='rule to test'))
|
help='rule to test.'))
|
||||||
|
|
||||||
conf.register_cli_opt(cfg.StrOpt(
|
conf.register_cli_opt(cfg.BoolOpt(
|
||||||
'is_admin',
|
'is_admin',
|
||||||
help='set is_admin=True on the credentials used for the evaluation',
|
help='set is_admin=True on the credentials used for the evaluation.',
|
||||||
default=""))
|
default=False))
|
||||||
|
|
||||||
conf()
|
conf()
|
||||||
|
|
||||||
is_admin = conf.is_admin.lower() == "true"
|
tool(conf.policy, conf.access, conf.rule, conf.is_admin, conf.target)
|
||||||
|
|
||||||
tool(conf.policy, conf.access, conf.rule, is_admin, conf.target)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user