Module Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias identifier ImportFrom alias FunctionDef arguments args defaults kwarg body Assign NameStore Dict Str Str Str Str Str BinOpMod Str Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Num BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr Num Num Call NameLoad Call AttributeLoad NameLoad attr Num BinOpAdd Call NameLoad Call AttributeLoad NameLoad attr Num Num Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Str Assign NameStore ListLoad Assign NameStore ListLoad TupleLoad Str Dict Str Str TupleLoad Str Dict Str Str Str ListLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad BinOpMod Str TupleLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body For NameStore SubscriptLoad NameLoad Index Str body If CompareEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Return Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body For NameStore SubscriptLoad NameLoad Index Str body If CompareEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Dict Str Call NameLoad keyword Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore Dict Str Call NameLoad keyword Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str Str Str Str Str Str Str Str Str Str Num Num Num Num Str Num Num Num NameLoad NameLoad Assign NameStore Dict Str Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Dict Str Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Dict Str Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str SubscriptLoad SubscriptLoad NameLoad Index Str Index Str keyword NameLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Str decorator_list decorator_list
N/A N/A six N/A testscenarios nova context nova db nova exception ex nova objects nova test nova.tests fixtures nova_fixtures nova.tests.functional api_paste_fixture nova.tests.functional integrated_helpers helper nova.tests.unit policy_fixture rand_flavor N/A N/A N/A kwargs N/A N/A flav N/A name id ram disk vcpus N/A name-%s N/A N/A helper generate_random_alphanumeric 10 N/A N/A helper generate_random_alphanumeric 10 N/A N/A int N/A N/A helper generate_random_numeric 2 1 N/A int N/A N/A helper generate_random_numeric 3 N/A N/A int N/A N/A helper generate_random_numeric 1 1 N/A N/A N/A flav update kwargs N/A flav N/A FlavorManageFullstack N/A N/A testscenarios WithScenarios N/A test TestCase N/A N/A Tests for flavors manage administrative command.

    Extension: os-flavors-manage

    os-flavors-manage adds a set of admin functions to the flavors
    resource for the creation and deletion of flavors.

    POST /v2/flavors:

    ::

        {
            'name': NAME, # string, required unique
            'id': ID, # string, required unique
            'ram': RAM, # in MB, required
            'vcpus': VCPUS, # int value, required
            'disk': DISK, # in GB, required
            'OS-FLV-EXT-DATA:ephemeral', # in GB, ephemeral disk size
            'is_public': IS_PUBLIC, # boolean
            'swap': SWAP, # in GB?
            'rxtx_factor': RXTX, # ???
        }

    Returns Flavor

    DELETE /v2/flavors/ID


    Functional Test Scope:

    This test starts the wsgi stack for the nova api services, uses an
    in memory database to ensure the path through the wsgi layer to
    the database.

     N/A _additional_fixtures N/A N/A scenarios N/A N/A v2_1 N/A api_major_version v2.1 N/A v2legacy N/A api_major_version _additional_fixtures v2 N/A N/A api_paste_fixture ApiPasteLegacyV2Fixture setUp N/A N/A self N/A N/A N/A N/A N/A N/A super FlavorManageFullstack self setUp N/A fix N/A self _additional_fixtures N/A N/A N/A N/A self useFixture N/A fix N/A N/A N/A self useFixture N/A N/A policy_fixture RealPolicyFixture N/A api_fixture N/A N/A self useFixture N/A N/A nova_fixtures OSAPIFixture api_version N/A self api_major_version N/A N/A self api N/A api_fixture admin_api N/A N/A self user_api N/A api_fixture api N/A assertFlavorDbEqual N/A N/A self flav flavdb N/A N/A N/A mapping N/A name disk ram vcpus id swap name root_gb memory_mb vcpus flavorid swap N/A N/A k v N/A N/A six iteritems mapping N/A N/A N/A k flav N/A N/A N/A N/A self assertEqual N/A flav N/A k N/A flavdb N/A v N/A %s != %s N/A flav flavdb N/A assertFlavorAPIEqual N/A N/A self flav flavapi N/A N/A N/A N/A k v N/A N/A six iteritems flav N/A N/A N/A k flavapi N/A N/A N/A N/A self assertEqual N/A flav N/A k N/A flavapi N/A k N/A %s != %s N/A flav flavapi N/A N/A N/A N/A self fail N/A Missing key: %s in flavor: %s N/A k flavapi N/A assertFlavorInList N/A N/A self flav flavlist N/A N/A N/A item N/A flavlist N/A flavors N/A N/A N/A N/A flav N/A id N/A item N/A id N/A N/A N/A N/A self assertEqual N/A flav N/A name N/A item N/A name N/A N/A N/A N/A self fail N/A %s not found in %s N/A flav flavlist N/A assertFlavorNotInList N/A N/A self flav flavlist N/A N/A N/A item N/A flavlist N/A flavors N/A N/A N/A N/A flav N/A id N/A item N/A id N/A N/A N/A N/A self fail N/A %s found in %s N/A flav flavlist N/A test_flavor_manage_func_negative N/A N/A self N/A N/A N/A Test flavor manage edge conditions.

        - Bogus body is a 400
        - Unknown flavor is a 404
        - Deleting unknown flavor is a 404
         N/A resp N/A N/A N/A self api api_post flavors check_response_status False N/A N/A N/A self assertEqual 400 N/A resp status N/A resp N/A N/A N/A self api api_delete flavors/foo check_response_status False N/A N/A N/A self assertEqual 404 N/A resp status N/A resp N/A N/A N/A self api api_delete flavors/foo check_response_status False N/A N/A N/A self assertEqual 404 N/A resp status N/A ctx N/A N/A context get_admin_context N/A flav N/A flavor N/A rand_flavor vcpus 0 N/A resp N/A N/A N/A self api api_post flavors flav check_response_status False N/A N/A N/A self assertEqual 400 N/A resp status resp N/A N/A N/A self assertRaises N/A ex FlavorNotFound N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav N/A flavor N/A id N/A flav N/A flavor N/A rand_flavor ram 0 N/A resp N/A N/A N/A self api api_post flavors flav check_response_status False N/A N/A N/A self assertEqual 400 N/A resp status N/A N/A N/A self assertRaises N/A ex FlavorNotFound N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav N/A flavor N/A id N/A test_flavor_manage_deleted N/A N/A self N/A N/A N/A Ensure the behavior around a deleted flavor is stable.

        - Fetching a deleted flavor works, and returns the flavor info.
        - Listings should not contain deleted flavors

         N/A new_flav N/A flavor N/A rand_flavor N/A N/A N/A N/A self api api_post flavors new_flav N/A N/A N/A N/A self api api_delete N/A flavors/%s N/A N/A new_flav N/A flavor N/A id N/A resp N/A N/A N/A self api api_get flavors N/A N/A N/A self assertFlavorNotInList N/A new_flav N/A flavor N/A resp body N/A test_flavor_create_frozen N/A N/A self N/A N/A N/A ctx N/A N/A context get_admin_context N/A N/A N/A db flavor_create ctx N/A name memory_mb vcpus root_gb ephemeral_gb flavorid swap rxtx_factor vcpu_weight disabled is_public foo 512 1 1 0 foo 0 1.0 1 False True N/A new_flav N/A flavor N/A rand_flavor N/A resp N/A N/A N/A self api api_post flavors new_flav check_response_status False N/A N/A N/A self assertEqual 409 N/A resp status N/A test_flavor_manage_func N/A N/A self N/A N/A N/A Basic flavor creation lifecycle testing.

        - Creating a flavor
        - Ensure it's in the database
        - Ensure it's in the listing
        - Delete it
        - Ensure it's hidden in the database
         N/A ctx N/A N/A context get_admin_context N/A flav1 N/A flavor N/A rand_flavor N/A N/A N/A N/A self api api_post flavors flav1 N/A flav1db N/A N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav1 N/A flavor N/A id N/A N/A N/A self assertFlavorDbEqual N/A flav1 N/A flavor flav1db N/A resp N/A N/A N/A self api api_get flavors N/A N/A N/A self assertFlavorInList N/A flav1 N/A flavor N/A resp body N/A N/A N/A N/A self api api_delete N/A flavors/%s N/A N/A flav1 N/A flavor N/A id N/A N/A N/A self assertRaises N/A ex FlavorNotFound N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav1 N/A flavor N/A id N/A resp N/A N/A N/A self api api_delete N/A flavors/%s N/A N/A flav1 N/A flavor N/A id check_response_status False N/A N/A N/A self assertEqual 404 N/A resp status N/A test_flavor_manage_permissions N/A N/A self N/A N/A N/A Ensure that regular users can't create or delete flavors.

         N/A ctx N/A N/A context get_admin_context N/A flav1 N/A flavor N/A rand_flavor N/A resp N/A N/A N/A self user_api api_post flavors flav1 check_response_status False N/A N/A N/A self assertEqual 403 N/A resp status N/A N/A N/A self assertRaises N/A ex FlavorNotFound N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav1 N/A flavor N/A id N/A N/A N/A N/A self api api_post flavors flav1 N/A resp N/A N/A N/A self user_api api_delete N/A flavors/%s N/A N/A flav1 N/A flavor N/A id check_response_status False N/A N/A N/A self assertEqual 403 N/A resp status N/A N/A N/A N/A objects Flavor get_by_flavor_id ctx N/A N/A flav1 N/A flavor N/A id N/A N/A