Module Import alias Import alias ImportFrom alias ImportFrom alias identifier ImportFrom alias Import alias ImportFrom alias Import alias ImportFrom alias Assign NameStore AttributeLoad NameLoad attr ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Str With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str ListLoad keyword Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults Str vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Str With Call NameLoad AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list
N/A N/A os N/A fixtures oslo_config cfg oslo_policy policy oslo_policy oslo_serialization jsonutils N/A six nova paths N/A nova.policy nova.tests.unit fake_policy N/A CONF N/A cfg CONF RealPolicyFixture N/A N/A fixtures Fixture N/A N/A Load the live policy for tests.

    A base policy fixture that starts with the assumption that you'd
    like to load and enforce the shipped default policy in tests.

    Provides interfaces to tinker with both the contents and location
    of the policy file before loading to allow overrides. To do this
    implement ``_prepare_policy`` in the subclass, and adjust the
    ``policy_file`` accordingly.

     _prepare_policy N/A N/A self N/A N/A N/A Allow changing of the policy before we get started N/A N/A setUp N/A N/A self N/A N/A N/A N/A N/A N/A super RealPolicyFixture self setUp N/A N/A self policy_file N/A N/A paths state_path_def etc/nova/policy.json N/A N/A N/A self _prepare_policy N/A N/A N/A CONF set_override policy_file N/A self policy_file group oslo_policy N/A N/A N/A N/A nova policy reset N/A N/A N/A N/A nova policy init N/A N/A N/A self addCleanup N/A N/A nova policy reset N/A set_rules N/A N/A self rules N/A N/A N/A policy N/A N/A nova policy _ENFORCER N/A N/A N/A policy set_rules N/A N/A N/A oslo_policy Rules from_dict rules N/A N/A PolicyFixture N/A RealPolicyFixture N/A N/A Load a fake policy from nova.tests.unit.fake_policy

    This overrides the policy with a completely fake and synthetic
    policy file.

    NOTE(sdague): the use of this is deprecated, and we should unwind
    the tests so that they can function with the real policy. This is
    mostly legacy because our default test instances and default test
    contexts don't match up. It appears that in many cases fake_policy
    was just modified to whatever makes tests pass, which makes it
    dangerous to be used in tree. Long term a NullPolicy fixture might
    be better in those cases.

     _prepare_policy N/A N/A self N/A N/A N/A N/A self policy_dir N/A N/A self useFixture N/A N/A fixtures TempDir N/A N/A self policy_file N/A N/A N/A os path join N/A N/A self policy_dir path policy.json N/A N/A open N/A self policy_file w f N/A N/A N/A N/A f write N/A fake_policy policy_data N/A N/A N/A CONF set_override policy_dirs N/A group oslo_policy N/A N/A RoleBasedPolicyFixture N/A RealPolicyFixture N/A N/A Load a modified policy which allows all actions only be a single roll.

    This fixture can be used for testing role based permissions as it
    provides a version of the policy which stomps over all previous
    declaration and makes every action only available to a single
    role.

    NOTE(sdague): we could probably do this simpler by only loading a
    single default rule.

     __init__ N/A N/A self role N/A admin args kwargs N/A N/A N/A N/A N/A super RoleBasedPolicyFixture self __init__ args kwargs N/A N/A self role role N/A _prepare_policy N/A N/A self N/A N/A N/A policy N/A N/A jsonutils load N/A open N/A N/A CONF oslo_policy policy_file N/A N/A action rule N/A N/A six iteritems policy N/A N/A N/A policy N/A action N/A role:%s N/A self role N/A N/A self policy_dir N/A N/A self useFixture N/A N/A fixtures TempDir N/A N/A self policy_file N/A N/A N/A os path join N/A N/A self policy_dir path policy.json N/A N/A open N/A self policy_file w f N/A N/A N/A N/A jsonutils dump policy f N/A N/A